Skip to content

Commit 3c914d1

Browse files
Apply review comments
1 parent 396f52c commit 3c914d1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

marshal.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ func marshalVector(info VectorType, value interface{}) ([]byte, error) {
17581758
}
17591759
return buf.Bytes(), nil
17601760
}
1761-
return nil, marshalErrorf("can not marshal %T into %s", value, info)
1761+
return nil, marshalErrorf("can not marshal %T into %s. Accepted types: slice, array.", value, info)
17621762
}
17631763

17641764
func unmarshalVector(info VectorType, data []byte, value interface{}) error {
@@ -1792,7 +1792,7 @@ func unmarshalVector(info VectorType, data []byte, value interface{}) error {
17921792
for i := 0; i < info.Dimensions; i++ {
17931793
offset := 0
17941794
if isVectorVariableLengthType(info.SubType) {
1795-
m, p, err := readUnsignedVint(data, 0)
1795+
m, p, err := readUnsignedVInt(data, 0)
17961796
if err != nil {
17971797
return err
17981798
}
@@ -1817,7 +1817,7 @@ func unmarshalVector(info VectorType, data []byte, value interface{}) error {
18171817
}
18181818
return nil
18191819
}
1820-
return unmarshalErrorf("can not unmarshal %s into %T", info, value)
1820+
return unmarshalErrorf("can not unmarshal %s into %T. Accepted types: slice, array.", info, value)
18211821
}
18221822

18231823
func isVectorVariableLengthType(elemType TypeInfo) bool {
@@ -1862,7 +1862,7 @@ func writeUnsignedVInt(buf *bytes.Buffer, v uint64) {
18621862
buf.Write(tmp)
18631863
}
18641864

1865-
func readUnsignedVint(data []byte, start int) (uint64, int, error) {
1865+
func readUnsignedVInt(data []byte, start int) (uint64, int, error) {
18661866
if len(data) <= start {
18671867
return 0, 0, errors.New("unexpected eof")
18681868
}

marshal_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,7 +2510,7 @@ func TestReadCollectionSize(t *testing.T) {
25102510
}
25112511
}
25122512

2513-
func TestReadUnsignedVint(t *testing.T) {
2513+
func TestReadUnsignedVInt(t *testing.T) {
25142514
tests := []struct {
25152515
decodedInt uint64
25162516
encodedVint []byte
@@ -2530,7 +2530,7 @@ func TestReadUnsignedVint(t *testing.T) {
25302530
}
25312531
for _, test := range tests {
25322532
t.Run(fmt.Sprintf("%d", test.decodedInt), func(t *testing.T) {
2533-
actual, _, err := readUnsignedVint(test.encodedVint, 0)
2533+
actual, _, err := readUnsignedVInt(test.encodedVint, 0)
25342534
if err != nil {
25352535
t.Fatalf("Expected no error, got %v", err)
25362536
}

0 commit comments

Comments
 (0)