From 8079d8e166c87d584e5c86c3f6d94c2463ad541e Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Thu, 3 Oct 2024 14:55:18 -0600 Subject: [PATCH 1/2] Update linter version and fix linting --- .travis.yml | 2 +- internal/p2p/gossip.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6d2f7f..f9958cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ jobs: install: - sudo gem install coveralls-lcov - go install github.com/jandelgado/gcov2lcov@latest - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 - go get ./... script: - go build -ldflags="-X main.Commit=$(git rev-parse HEAD)" cmd/koinos-p2p/main.go diff --git a/internal/p2p/gossip.go b/internal/p2p/gossip.go index 814cd44..74b4a70 100644 --- a/internal/p2p/gossip.go +++ b/internal/p2p/gossip.go @@ -130,7 +130,7 @@ func readMessages(ctx context.Context, ch chan<- []byte, sub *pubsub.Subscriptio // for { msg, err := sub.Next(ctx) - if err != nil && !errors.Is(context.DeadlineExceeded, err) { + if err != nil && !errors.Is(err, context.DeadlineExceeded) { log.Warnf("Error getting message for topic %s: %s", topicName, err) return } From 7d85731aa1cd3d87ddb12b3ce84744a629628a68 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Thu, 3 Oct 2024 15:31:18 -0600 Subject: [PATCH 2/2] Bump linter timeout to 2m --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9958cd..b19e27c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ jobs: - gcov2lcov -infile=internal.out -outfile=internal.info - gcov2lcov -infile=node.out -outfile=node.info - gcov2lcov -infile=p2p.out -outfile=p2p.info - - golangci-lint run ./... + - golangci-lint run --timeout=2m ./... after_success: - coveralls-lcov --repo-token "$COVERALLS_REPO_TOKEN" --service-name travis-pro coverage.info