Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Makefile with a fmt rule #128

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fmt:
gofmt -s -w .
gofumpt -extra -w .
gci write .
go mod tidy
2 changes: 1 addition & 1 deletion api/v1/attesterduty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestAttesterDutyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/beaconblockheader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestBeaconBlockHeaderJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/beaconcommittee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestBeaconCommitteeJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/beaconcommitteesubscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestBeaconCommitteeSubscriptionJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/bellatrix/blindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/bellatrix"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/bellatrix/blindedbeaconblockbody_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/bellatrix"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockBodyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/bellatrix/signedblindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/bellatrix"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestSignedBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/blobsidecarevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

api "github.com/attestantio/go-eth2-client/api/v1"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlobSidecarEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/blockevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestBlockEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/capella/blindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"github.com/attestantio/go-eth2-client/api/v1/capella"
"github.com/goccy/go-yaml"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/capella/blindedbeaconblockbody_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/capella"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockBodyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/capella/signedblindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

"github.com/attestantio/go-eth2-client/api/v1/capella"
"github.com/goccy/go-yaml"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSignedBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/chainreorgevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestChainReorgEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/deneb/blindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/deneb"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/deneb/blindedbeaconblockbody_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/deneb"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlindedBeaconBlockBodyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/deneb/blockcontents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/deneb"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestBlockContentsJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/deneb/signedblindedbeaconblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/deneb"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestSignedBlindedBeaconBlockJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/deneb/signedblockcontents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/attestantio/go-eth2-client/api/v1/deneb"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestSignedBlockContentsJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/depositcontract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestDepositContractJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestEvent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/finality_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestFinalityJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/finalizedcheckpointevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestFinalizedCheckpointEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestGenesisJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/headevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestHeadEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/payloadattributesevent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

api "github.com/attestantio/go-eth2-client/api/v1"
"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestPayloadAttributesEventJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/peers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)

func TestNodePeerJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/proposalpreparation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestProposalPreparationJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/proposerduty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestProposerDutyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/signedvalidatorregistration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

api "github.com/attestantio/go-eth2-client/api/v1"
"github.com/goccy/go-yaml"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSignedValidatorRegistrationJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/synccommittee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSyncCommitteeJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/synccommitteeduty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSyncCommitteeDutyJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/synccommitteesubscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSyncCommitteeSubscriptionJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/syncstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestSyncStateJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestValidatorJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/validatorbalance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

api "github.com/attestantio/go-eth2-client/api/v1"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestValidatorBalanceJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/validatorregistration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

api "github.com/attestantio/go-eth2-client/api/v1"
"github.com/goccy/go-yaml"
require "github.com/stretchr/testify/require"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestValidatorRegistrationJSON(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/v1/validatorstate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func TestMarshalJSON(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
require.NotPanics(t, func() {
res, err := json.Marshal(&test.state) //test.state.MarshalJSON()
res, err := json.Marshal(&test.state) // test.state.MarshalJSON()
test.errFunc(t, err)
require.Equal(t, test.expected, res)
})
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/rs/zerolog v1.32.0
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel/trace v1.16.0
golang.org/x/crypto v0.20.0
golang.org/x/sync v0.2.0
)
Expand All @@ -41,7 +42,6 @@ require (
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
Expand Down
2 changes: 1 addition & 1 deletion http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func metadataFromHeaders(headers map[string]string) map[string]any {
}

// urlForCall patches together a URL for a call.
func urlForCall(base *url.URL, endpoint string, query string) *url.URL {
func urlForCall(base *url.URL, endpoint, query string) *url.URL {
callURL := *base
callURL.Path = endpoint
if callURL.RawQuery == "" {
Expand Down
Loading
Loading