From 2a8257ed1c20401bd3ee47ddc57f970ba01738eb Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Tue, 3 Sep 2024 09:09:12 +1000 Subject: [PATCH] chore: Fix lint error golangci-lint v1.60.2 seems to report a new error when performing a nil check and length != 0 on maps. We're not using this version in CI yet but fix the error to simplify the code and provide for a future upgrade. --- op-chain-ops/genesis/layer_one.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-chain-ops/genesis/layer_one.go b/op-chain-ops/genesis/layer_one.go index e7d569276496..7178cccebb94 100644 --- a/op-chain-ops/genesis/layer_one.go +++ b/op-chain-ops/genesis/layer_one.go @@ -31,7 +31,7 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *foundry.ForgeAllocs, l1 return nil, fmt.Errorf("cannot create L1 developer genesis: %w", err) } - if genesis.Alloc != nil && len(genesis.Alloc) != 0 { + if len(genesis.Alloc) != 0 { panic("Did not expect NewL1Genesis to generate non-empty state") // sanity check for dev purposes. } // copy, for safety when the dump is reused (like in e2e testing)