From 5cee33eb7234756939b1ef8b23e990b672a03dff Mon Sep 17 00:00:00 2001 From: baptiste-b-pegasys <85155432+baptiste-b-pegasys@users.noreply.github.com> Date: Tue, 24 Aug 2021 14:27:15 +0200 Subject: [PATCH] tests/fuzzers: fix go vet warning about ReadByte (#23380) --- tests/fuzzers/trie/trie-fuzzer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/fuzzers/trie/trie-fuzzer.go b/tests/fuzzers/trie/trie-fuzzer.go index 762ab5f34..d0b614c9a 100644 --- a/tests/fuzzers/trie/trie-fuzzer.go +++ b/tests/fuzzers/trie/trie-fuzzer.go @@ -69,7 +69,7 @@ func newDataSource(input []byte) *dataSource { input, bytes.NewReader(input), } } -func (ds *dataSource) ReadByte() byte { +func (ds *dataSource) readByte() byte { if b, err := ds.reader.ReadByte(); err != nil { return 0 } else { @@ -89,22 +89,22 @@ func Generate(input []byte) randTest { r := newDataSource(input) genKey := func() []byte { - if len(allKeys) < 2 || r.ReadByte() < 0x0f { + if len(allKeys) < 2 || r.readByte() < 0x0f { // new key - key := make([]byte, r.ReadByte()%50) + key := make([]byte, r.readByte()%50) r.Read(key) allKeys = append(allKeys, key) return key } // use existing key - return allKeys[int(r.ReadByte())%len(allKeys)] + return allKeys[int(r.readByte())%len(allKeys)] } var steps randTest for i := 0; !r.Ended(); i++ { - step := randTestStep{op: int(r.ReadByte()) % opMax} + step := randTestStep{op: int(r.readByte()) % opMax} switch step.op { case opUpdate: step.key = genKey()