mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
chore: rename variable name int to n
This commit is contained in:
parent
08b5204e4b
commit
58a3d2330e
2 changed files with 4 additions and 4 deletions
|
|
@ -180,9 +180,9 @@ func BenchmarkByteAtOld(b *testing.B) {
|
||||||
func TestReadBits(t *testing.T) {
|
func TestReadBits(t *testing.T) {
|
||||||
check := func(input string) {
|
check := func(input string) {
|
||||||
want, _ := hex.DecodeString(input)
|
want, _ := hex.DecodeString(input)
|
||||||
in, _ := new(big.Int).SetString(input, 16)
|
n, _ := new(big.Int).SetString(input, 16)
|
||||||
buf := make([]byte, len(want))
|
buf := make([]byte, len(want))
|
||||||
ReadBits(in, buf)
|
ReadBits(n, buf)
|
||||||
if !bytes.Equal(buf, want) {
|
if !bytes.Equal(buf, want) {
|
||||||
t.Errorf("have: %x\nwant: %x", buf, want)
|
t.Errorf("have: %x\nwant: %x", buf, want)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,11 @@ func (i *HexOrDecimal64) UnmarshalJSON(input []byte) error {
|
||||||
|
|
||||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
// UnmarshalText implements encoding.TextUnmarshaler.
|
||||||
func (i *HexOrDecimal64) UnmarshalText(input []byte) error {
|
func (i *HexOrDecimal64) UnmarshalText(input []byte) error {
|
||||||
in, ok := ParseUint64(string(input))
|
n, ok := ParseUint64(string(input))
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("invalid hex or decimal integer %q", input)
|
return fmt.Errorf("invalid hex or decimal integer %q", input)
|
||||||
}
|
}
|
||||||
*i = HexOrDecimal64(in)
|
*i = HexOrDecimal64(n)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue