Browse Source

codec: use exact value for word size, instead of depending on strconv

Ugorji Nwoke 8 years ago
parent
commit
0d023046ac
2 changed files with 2 additions and 2 deletions
  1. 1 1
      codec/gen.go
  2. 1 1
      codec/mammoth2_codecgen_generated_test.go

+ 1 - 1
codec/gen.go

@@ -278,7 +278,7 @@ func Gen(w io.Writer, buildTags, pkgName, uid string, noExtensions bool,
 		x.linef("codecSelferValueType%s%s = %v", vt.String(), x.xs, int64(vt))
 	}
 
-	x.linef("codecSelferBitsize%s = uint8(strconv.IntSize) // uint8(32 << (^uint(0) >> 63))", x.xs)
+	x.linef("codecSelferBitsize%s = uint8(32 << (^uint(0) >> 63))", x.xs)
 	x.line(")")
 	x.line("var (")
 	x.line("errCodecSelferOnlyMapOrArrayEncodeToStruct" + x.xs + " = errors.New(`only encoded map or array can be decoded into a struct`)")

+ 1 - 1
codec/mammoth2_codecgen_generated_test.go

@@ -21,7 +21,7 @@ const (
 	codecSelferValueTypeInt19781    = 2
 	codecSelferValueTypeUint19781   = 3
 	codecSelferValueTypeFloat19781  = 4
-	codecSelferBitsize19781         = uint8(strconv.IntSize) // uint8(32 << (^uint(0) >> 63))
+	codecSelferBitsize19781         = uint8(32 << (^uint(0) >> 63))
 )
 
 var (