Skip to content

Commit

Permalink
Correct comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ymz-ncnk committed Jan 8, 2025
1 parent c76f65a commit bda13b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ord/byte_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func MarshalByteSlice(v []byte, lenM mus.Marshaller[int], bs []byte) (n int) {
// nil, varint.UnmarshalPositiveInt() is used.
//
// In addition to the slice value and the number of used bytes, it may also
// return mus.ErrTooSmallByteSlice, com.ErrOverflow, com.ErrNegativeLength.
// return mus.ErrTooSmallByteSlice, com.ErrOverflow or com.ErrNegativeLength.
func UnmarshalByteSlice(lenU mus.Unmarshaller[int], bs []byte) (v []byte,
n int, err error) {
return UnmarshalValidByteSlice(lenU, nil, false, bs)
Expand All @@ -42,7 +42,8 @@ func UnmarshalByteSlice(lenU mus.Unmarshaller[int], bs []byte) (v []byte,
// The lenU argument specifies the Unmarshaller for the length of the slice, if
// nil, varint.UnmarshalPositiveInt() is used.
// The lenVl argument specifies the slice length Validator. If it returns
// an error and skip == true, UnmarshalValidByteSlice skips the remaining bytes.
// an error and skip == true, UnmarshalValidByteSlice skips the remaining bytes
// of the slice.
//
// In addition to the slice value and the number of used bytes, it may also
// return mus.ErrTooSmallByteSlice, com.ErrOverflow or com.ErrNegativeLength.
Expand Down
2 changes: 1 addition & 1 deletion ord/ord_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ func TestOrd(t *testing.T) {
com_testdata.TestSkipResults(wantN, n, wantErr, err, nil, t)
})

t.Run("SkipByteSliceVarint should return ErrNegativeLength if there is no space in bs",
t.Run("SkipByteSliceVarint should return ErrNegativeLength if meets a negative length",
func(t *testing.T) {
var (
wantN = 1
Expand Down

0 comments on commit bda13b1

Please sign in to comment.