Skip to content

Commit

Permalink
[chore] fix typos (#35746)
Browse files Browse the repository at this point in the history
Found some typos, fixing them.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten authored Oct 11, 2024
1 parent d889e67 commit c6bceb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/telemetrygen/internal/common/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
)

var (
errInvalidTraceIDLenght = fmt.Errorf("TraceID must be a 32 character hex string, like: 'ae87dadd90e9935a4bc9660628efd569'")
errInvalidSpanIDLenght = fmt.Errorf("SpanID must be a 16 character hex string, like: '5828fa4960140870'")
errInvalidTraceIDLength = fmt.Errorf("TraceID must be a 32 character hex string, like: 'ae87dadd90e9935a4bc9660628efd569'")
errInvalidSpanIDLength = fmt.Errorf("SpanID must be a 16 character hex string, like: '5828fa4960140870'")
errInvalidTraceID = fmt.Errorf("failed to create traceID byte array from the given traceID, make sure the traceID is a hex representation of a [16]byte, like: 'ae87dadd90e9935a4bc9660628efd569'")
errInvalidSpanID = fmt.Errorf("failed to create SpanID byte array from the given SpanID, make sure the SpanID is a hex representation of a [8]byte, like: '5828fa4960140870'")
)

func ValidateTraceID(traceID string) error {
if len(traceID) != 32 {
return errInvalidTraceIDLenght
return errInvalidTraceIDLength
}

_, err := hex.DecodeString(traceID)
Expand All @@ -30,7 +30,7 @@ func ValidateTraceID(traceID string) error {

func ValidateSpanID(spanID string) error {
if len(spanID) != 16 {
return errInvalidSpanIDLenght
return errInvalidSpanIDLength
}
_, err := hex.DecodeString(spanID)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/telemetrygen/internal/common/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestValidateTraceID(t *testing.T) {
{
name: "InvalidLength",
traceID: "invalid-length",
expected: errInvalidTraceIDLenght,
expected: errInvalidTraceIDLength,
},
{
name: "InvalidTraceID",
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestValidateSpanID(t *testing.T) {
{
name: "InvalidLength",
spanID: "invalid-length",
expected: errInvalidSpanIDLenght,
expected: errInvalidSpanIDLength,
},
{
name: "InvalidTraceID",
Expand Down

0 comments on commit c6bceb6

Please sign in to comment.