diff --git a/beacon-chain/blockchain/chain_info_norace_test.go b/beacon-chain/blockchain/chain_info_norace_test.go index 1919ff52a0..cc872327c4 100644 --- a/beacon-chain/blockchain/chain_info_norace_test.go +++ b/beacon-chain/blockchain/chain_info_norace_test.go @@ -17,7 +17,7 @@ func TestHeadSlot_DataRace(t *testing.T) { beaconDB: db, } go func() { - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } }() @@ -33,7 +33,7 @@ func TestHeadRoot_DataRace(t *testing.T) { stateGen: stategen.New(db, cache.NewStateSummaryCache()), } go func() { - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } }() @@ -51,7 +51,7 @@ func TestHeadBlock_DataRace(t *testing.T) { stateGen: stategen.New(db, cache.NewStateSummaryCache()), } go func() { - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } }() @@ -68,7 +68,7 @@ func TestHeadState_DataRace(t *testing.T) { stateGen: stategen.New(db, cache.NewStateSummaryCache()), } go func() { - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } }() diff --git a/beacon-chain/blockchain/service_norace_test.go b/beacon-chain/blockchain/service_norace_test.go index 38aec84398..d83380b892 100644 --- a/beacon-chain/blockchain/service_norace_test.go +++ b/beacon-chain/blockchain/service_norace_test.go @@ -21,11 +21,11 @@ func TestChainService_SaveHead_DataRace(t *testing.T) { beaconDB: db, } go func() { - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } }() - if err := s.saveHead(context.Background(), [32]byte{}, ); err != nil { + if err := s.saveHead(context.Background(), [32]byte{}); err != nil { t.Fatal(err) } } diff --git a/beacon-chain/cache/checkpoint_state_test.go b/beacon-chain/cache/checkpoint_state_test.go index 8c64aaba5d..18aab49da2 100644 --- a/beacon-chain/cache/checkpoint_state_test.go +++ b/beacon-chain/cache/checkpoint_state_test.go @@ -5,12 +5,12 @@ import ( "testing" "github.com/gogo/protobuf/proto" - "github.com/prysmaticlabs/prysm/shared/params" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" stateTrie "github.com/prysmaticlabs/prysm/beacon-chain/state" pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" "github.com/prysmaticlabs/prysm/shared/bytesutil" "github.com/prysmaticlabs/prysm/shared/hashutil" + "github.com/prysmaticlabs/prysm/shared/params" ) func TestCheckpointStateCacheKeyFn_OK(t *testing.T) { diff --git a/beacon-chain/cache/committee_ids.go b/beacon-chain/cache/committee_ids.go index 82cbdfb4e7..d61d863fa3 100644 --- a/beacon-chain/cache/committee_ids.go +++ b/beacon-chain/cache/committee_ids.go @@ -56,7 +56,7 @@ func (c *committeeIDs) GetAttesterCommitteeIDs(slot uint64) []uint64 { return nil } if v, ok := val.([]uint64); ok { - return v + return v } return nil } diff --git a/beacon-chain/state/references_test.go b/beacon-chain/state/references_test.go index 41c35d5ba6..8351bd4d74 100644 --- a/beacon-chain/state/references_test.go +++ b/beacon-chain/state/references_test.go @@ -370,8 +370,8 @@ func TestStateReferenceCopy_NoUnexpectedAttestationsMutation(t *testing.T) { // Update initial state. atts := []*p2ppb.PendingAttestation{ - {AggregationBits: bitfield.NewBitlist(1),}, - {AggregationBits: bitfield.NewBitlist(2),}, + {AggregationBits: bitfield.NewBitlist(1)}, + {AggregationBits: bitfield.NewBitlist(2)}, } if err := a.SetPreviousEpochAttestations(atts[:1]); err != nil { t.Fatal(err) diff --git a/shared/bytesutil/bytes_test.go b/shared/bytesutil/bytes_test.go index 3045ce7194..d5aabf0aff 100644 --- a/shared/bytesutil/bytes_test.go +++ b/shared/bytesutil/bytes_test.go @@ -244,10 +244,10 @@ func TestReverse(t *testing.T) { input [][32]byte output [][32]byte }{ - {[][32]byte{[32]byte{'A'}, [32]byte{'B'}, [32]byte{'C'}, [32]byte{'D'}, [32]byte{'E'}, [32]byte{'F'}, [32]byte{'G'}, [32]byte{'H'}}, - [][32]byte{[32]byte{'H'}, [32]byte{'G'}, [32]byte{'F'}, [32]byte{'E'}, [32]byte{'D'}, [32]byte{'C'}, [32]byte{'B'}, [32]byte{'A'}}}, - {[][32]byte{[32]byte{1}, [32]byte{2}, [32]byte{3}, [32]byte{4}}, - [][32]byte{[32]byte{4}, [32]byte{3}, [32]byte{2}, [32]byte{1}}}, + {[][32]byte{{'A'}, {'B'}, {'C'}, {'D'}, {'E'}, {'F'}, {'G'}, {'H'}}, + [][32]byte{{'H'}, {'G'}, {'F'}, {'E'}, {'D'}, {'C'}, {'B'}, {'A'}}}, + {[][32]byte{{1}, {2}, {3}, {4}}, + [][32]byte{{4}, {3}, {2}, {1}}}, {[][32]byte{}, [][32]byte{}}, } for _, tt := range tests { diff --git a/shared/keystore/deposit_input.go b/shared/keystore/deposit_input.go index 1b852d73bf..25ab7e965e 100644 --- a/shared/keystore/deposit_input.go +++ b/shared/keystore/deposit_input.go @@ -35,7 +35,7 @@ func DepositInput(depositKey *Key, withdrawalKey *Key, amountInGwei uint64) (*et return nil, [32]byte{}, err } - domain, err := helpers.ComputeDomain(params.BeaconConfig().DomainDeposit, nil /*forkVersion*/, nil/*genesisValidatorsRoot*/) + domain, err := helpers.ComputeDomain(params.BeaconConfig().DomainDeposit, nil /*forkVersion*/, nil /*genesisValidatorsRoot*/) if err != nil { return nil, [32]byte{}, err } diff --git a/tools/analyzers/errcheck/embedded_walker_test.go b/tools/analyzers/errcheck/embedded_walker_test.go index 51c13a23b1..c7a8e709ee 100644 --- a/tools/analyzers/errcheck/embedded_walker_test.go +++ b/tools/analyzers/errcheck/embedded_walker_test.go @@ -35,12 +35,12 @@ type testCase struct { func TestWalkThroughEmbeddedInterfaces(t *testing.T) { cases := []testCase{ - testCase{"Inner{}.Method", false, nil}, - testCase{"(&Inner{}).Method", false, nil}, - testCase{"Outer{}.Method", false, nil}, - testCase{"InnerInterface.Method", true, []string{"test.InnerInterface"}}, - testCase{"OuterInterface.Method", true, []string{"test.OuterInterface", "test.InnerInterface"}}, - testCase{"OuterInterfaceStruct.Method", true, []string{"test.OuterInterface", "test.InnerInterface"}}, + {"Inner{}.Method", false, nil}, + {"(&Inner{}).Method", false, nil}, + {"Outer{}.Method", false, nil}, + {"InnerInterface.Method", true, []string{"test.InnerInterface"}}, + {"OuterInterface.Method", true, []string{"test.OuterInterface", "test.InnerInterface"}}, + {"OuterInterfaceStruct.Method", true, []string{"test.OuterInterface", "test.InnerInterface"}}, } for _, c := range cases {