GetUOffsetT must get value by GetUint32 not GetInt32 (#6072)
authorThanabodee Charoenpiriyakij <thanabodee.c@linecorp.com>
Fri, 19 Feb 2021 02:38:25 +0000 (09:38 +0700)
committerGitHub <noreply@github.com>
Fri, 19 Feb 2021 02:38:25 +0000 (18:38 -0800)
go/encode.go

index 72d4f3a..a2a5798 100644 (file)
@@ -118,7 +118,7 @@ func GetFloat64(buf []byte) float64 {
 
 // GetUOffsetT decodes a little-endian UOffsetT from a byte slice.
 func GetUOffsetT(buf []byte) UOffsetT {
-       return UOffsetT(GetInt32(buf))
+       return UOffsetT(GetUint32(buf))
 }
 
 // GetSOffsetT decodes a little-endian SOffsetT from a byte slice.