@@ -894,14 +894,14 @@ func addPrimitiveRandomValues(t *testing.T, pool *map[TypeKind][]testUnit) {
894894 ufixedIndex := 0
895895
896896 for bitSize := uintBegin ; bitSize <= uintEnd ; bitSize += uintStepLength {
897- max := new (big.Int ).Lsh (big .NewInt (1 ), uint (bitSize ))
897+ lshBase := new (big.Int ).Lsh (big .NewInt (1 ), uint (bitSize ))
898898
899899 uintT , err := makeUintType (bitSize )
900900 require .NoError (t , err , "make uint type failure" )
901901 uintTstr := uintT .String ()
902902
903903 for j := 0 ; j < uintTestCaseCount ; j ++ {
904- randVal , err := rand .Int (rand .Reader , max )
904+ randVal , err := rand .Int (rand .Reader , lshBase )
905905 require .NoError (t , err , "generate random uint, should be no error" )
906906
907907 narrowest , err := castBigIntToNearestPrimitive (randVal , uint16 (bitSize ))
@@ -912,7 +912,7 @@ func addPrimitiveRandomValues(t *testing.T, pool *map[TypeKind][]testUnit) {
912912 }
913913
914914 for precision := 1 ; precision <= ufixedPrecision ; precision ++ {
915- randVal , err := rand .Int (rand .Reader , max )
915+ randVal , err := rand .Int (rand .Reader , lshBase )
916916 require .NoError (t , err , "generate random ufixed, should be no error" )
917917
918918 narrowest , err := castBigIntToNearestPrimitive (randVal , uint16 (bitSize ))
0 commit comments