Fix error by linter

This commit is contained in:
Masaaki Goshima 2021-02-09 22:20:23 +09:00
parent 721f830cef
commit 98de7ff51b
1 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ func copySlice(elemType *rtype, dst, src sliceHeader) int
//go:linkname newArray reflect.unsafe_NewArray //go:linkname newArray reflect.unsafe_NewArray
func newArray(*rtype, int) unsafe.Pointer func newArray(*rtype, int) unsafe.Pointer
func (d *sliceDecoder) errNumber(buf []byte, offset int64) *UnmarshalTypeError { func (d *sliceDecoder) errNumber(offset int64) *UnmarshalTypeError {
return &UnmarshalTypeError{ return &UnmarshalTypeError{
Value: "number", Value: "number",
Type: reflect.SliceOf(rtype2type(d.elemType)), Type: reflect.SliceOf(rtype2type(d.elemType)),
@ -152,7 +152,7 @@ func (d *sliceDecoder) decodeStream(s *stream, p unsafe.Pointer) error {
s.cursor++ s.cursor++
} }
case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': 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: case nul:
if s.read() { if s.read() {
continue continue
@ -249,7 +249,7 @@ func (d *sliceDecoder) decode(buf []byte, cursor int64, p unsafe.Pointer) (int64
cursor++ cursor++
} }
case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': 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: default:
goto ERROR goto ERROR
} }