From 98de7ff51be779be99cb28ee4f75d24503d29f6a Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Tue, 9 Feb 2021 22:20:23 +0900 Subject: [PATCH] Fix error by linter --- decode_slice.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decode_slice.go b/decode_slice.go index 6c26b11..39dae6f 100644 --- a/decode_slice.go +++ b/decode_slice.go @@ -63,7 +63,7 @@ func copySlice(elemType *rtype, dst, src sliceHeader) int //go:linkname newArray reflect.unsafe_NewArray func newArray(*rtype, int) unsafe.Pointer -func (d *sliceDecoder) errNumber(buf []byte, offset int64) *UnmarshalTypeError { +func (d *sliceDecoder) errNumber(offset int64) *UnmarshalTypeError { return &UnmarshalTypeError{ Value: "number", Type: reflect.SliceOf(rtype2type(d.elemType)), @@ -152,7 +152,7 @@ func (d *sliceDecoder) decodeStream(s *stream, p unsafe.Pointer) error { s.cursor++ } case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return d.errNumber([]byte{s.char()}, s.totalOffset()) + return d.errNumber(s.totalOffset()) case nul: if s.read() { continue @@ -249,7 +249,7 @@ func (d *sliceDecoder) decode(buf []byte, cursor int64, p unsafe.Pointer) (int64 cursor++ } case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return 0, d.errNumber([]byte{buf[cursor]}, cursor) + return 0, d.errNumber(cursor) default: goto ERROR }