From 35a1eb92a6d9c25c838bab3e48908d47738c2536 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Thu, 4 Sep 2025 17:04:54 -0400 Subject: [PATCH 1/2] style: enable nilerr linter (#1182) Signed-off-by: Jonathan Oppenheimer <147infiniti@gmail.com> Co-authored-by: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> --- .avalanche-golangci.yml | 2 +- sync/statesync/trie_sync_tasks.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.avalanche-golangci.yml b/.avalanche-golangci.yml index d029774226..3e7e195ef8 100644 --- a/.avalanche-golangci.yml +++ b/.avalanche-golangci.yml @@ -67,7 +67,7 @@ linters: - ineffassign - misspell - nakedret - # - nilerr + - nilerr - noctx - nolintlint - perfsprint diff --git a/sync/statesync/trie_sync_tasks.go b/sync/statesync/trie_sync_tasks.go index 6791c99a6b..40f1075f3a 100644 --- a/sync/statesync/trie_sync_tasks.go +++ b/sync/statesync/trie_sync_tasks.go @@ -117,7 +117,7 @@ func (s *storageTrieTask) OnStart() (bool, error) { } storageTrie, err := trie.New(trie.StorageTrieID(s.sync.root, s.root, firstAccount), s.sync.trieDB) if err != nil { - return false, nil + return false, nil //nolint:nilerr // the storage trie does not exist, so it should be rerequested } // If the storage trie is already on disk, we only need to populate the storage snapshot for [accountHash] From a1bc9f936ec99bb4374e8015fd1c90a03ff9a951 Mon Sep 17 00:00:00 2001 From: Jonathan Oppenheimer Date: Mon, 29 Sep 2025 14:43:53 -0400 Subject: [PATCH 2/2] lint --- plugin/evm/customtypes/rlp_fuzzer_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/evm/customtypes/rlp_fuzzer_test.go b/plugin/evm/customtypes/rlp_fuzzer_test.go index 99604f1246..d6227f6d82 100644 --- a/plugin/evm/customtypes/rlp_fuzzer_test.go +++ b/plugin/evm/customtypes/rlp_fuzzer_test.go @@ -44,8 +44,7 @@ import ( func decodeEncode(input []byte, val interface{}) error { if err := rlp.DecodeBytes(input, val); err != nil { - // not valid rlp, nothing to do - return nil + return nil //nolint:nilerr // not valid rlp, nothing to do } // If it _were_ valid rlp, we can encode it again output, err := rlp.EncodeToBytes(val)