From 6cc02641c3325a015c090ca6b2e2b95727404203 Mon Sep 17 00:00:00 2001 From: noot Date: Wed, 3 Nov 2021 16:11:02 -0400 Subject: [PATCH] fix lint --- dot/core/service.go | 1 - lib/runtime/test_helpers.go | 13 +++++++++---- scripts/install-lint.sh | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dot/core/service.go b/dot/core/service.go index 289881e8dc..f79dd56f5e 100644 --- a/dot/core/service.go +++ b/dot/core/service.go @@ -324,7 +324,6 @@ func (s *Service) handleBlocksAsync() { } s.maintainTransactionPool(block) - case <-s.ctx.Done(): return } diff --git a/lib/runtime/test_helpers.go b/lib/runtime/test_helpers.go index c6e969e69d..59da6fd68d 100644 --- a/lib/runtime/test_helpers.go +++ b/lib/runtime/test_helpers.go @@ -89,9 +89,6 @@ func GetRuntimeBlob(testRuntimeFilePath, testRuntimeURL string) (n int64, err er if err != nil { return 0, err } - defer func() { - _ = out.Close() - }() /* #nosec */ resp, err := http.Get(testRuntimeURL) @@ -103,7 +100,15 @@ func GetRuntimeBlob(testRuntimeFilePath, testRuntimeURL string) (n int64, err er }() n, err = io.Copy(out, resp.Body) - return n, err + if err != nil { + return 0, err + } + + if err = out.Close(); err != nil { + return 0, err + } + + return n, nil } // TestRuntimeNetwork ... diff --git a/scripts/install-lint.sh b/scripts/install-lint.sh index 30b7c6baaa..bd1e4cf175 100755 --- a/scripts/install-lint.sh +++ b/scripts/install-lint.sh @@ -6,7 +6,7 @@ fi if ! command -v golangci-lint &> /dev/null then - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0 fi export PATH=$PATH:$(go env GOPATH)/bin \ No newline at end of file