Skip to content

Commit ff68cba

Browse files
authored
Merge pull request #2054 from CortexFoundation/dev
common/math: rename variable name `int` to `n`
2 parents 5b696b1 + 3fe3c1b commit ff68cba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

common/math/big_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ func BenchmarkByteAtOld(b *testing.B) {
181181
func TestReadBits(t *testing.T) {
182182
check := func(input string) {
183183
want, _ := hex.DecodeString(input)
184-
int, _ := new(big.Int).SetString(input, 16)
184+
n, _ := new(big.Int).SetString(input, 16)
185185
buf := make([]byte, len(want))
186-
ReadBits(int, buf)
186+
ReadBits(n, buf)
187187
if !bytes.Equal(buf, want) {
188188
t.Errorf("have: %x\nwant: %x", buf, want)
189189
}

common/math/integer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ func (i *HexOrDecimal64) UnmarshalJSON(input []byte) error {
5454

5555
// UnmarshalText implements encoding.TextUnmarshaler.
5656
func (i *HexOrDecimal64) UnmarshalText(input []byte) error {
57-
int, ok := ParseUint64(string(input))
57+
n, ok := ParseUint64(string(input))
5858
if !ok {
5959
return fmt.Errorf("invalid hex or decimal integer %q", input)
6060
}
61-
*i = HexOrDecimal64(int)
61+
*i = HexOrDecimal64(n)
6262
return nil
6363
}
6464

0 commit comments

Comments
 (0)