From cc197771ec29afef0921c88c2ff005297a9419c4 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Fri, 24 Jun 2022 09:08:12 -0700 Subject: [PATCH] Allow compile and staticheck to pass. Signed-off-by: Derek Collison --- .travis.yml | 6 +++--- runTestsOnTravis.sh => scripts/runTestsOnTravis.sh | 2 +- server/server.go | 1 + server/store.go | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) rename runTestsOnTravis.sh => scripts/runTestsOnTravis.sh (97%) diff --git a/.travis.yml b/.travis.yml index a1d5e073..2030ae91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,10 @@ jobs: - name: "Run all tests from all other packages" env: TEST_SUITE=non_srv_pkg_tests - name: "Compile and various checks with older Go release" - go: 1.16.x + go: 1.17.x env: TEST_SUITE=compile -script: ./runTestsOnTravis.sh $TEST_SUITE +script: ./scripts/runTestsOnTravis.sh $TEST_SUITE deploy: provider: script @@ -43,4 +43,4 @@ deploy: script: curl -sL http://git.io/goreleaser | bash on: tags: true - condition: ($TRAVIS_GO_VERSION =~ 1.17) && ($TEST_SUITE = "compile") + condition: ($TRAVIS_GO_VERSION =~ 1.18) && ($TEST_SUITE = "compile") diff --git a/runTestsOnTravis.sh b/scripts/runTestsOnTravis.sh similarity index 97% rename from runTestsOnTravis.sh rename to scripts/runTestsOnTravis.sh index 0fb4e450..304e21f1 100755 --- a/runTestsOnTravis.sh +++ b/scripts/runTestsOnTravis.sh @@ -6,7 +6,7 @@ if [ "$1" = "compile" ]; then # We will compile and run some vet, spelling and some other checks. - go install honnef.co/go/tools/cmd/staticcheck@v0.2.2; + go install honnef.co/go/tools/cmd/staticcheck@latest; go install github.com/client9/misspell/cmd/misspell@latest; GO_LIST=$(go list ./...); go build; diff --git a/server/server.go b/server/server.go index 09fc9c92..21e2b0f0 100644 --- a/server/server.go +++ b/server/server.go @@ -3529,6 +3529,7 @@ func (s *Server) acceptError(acceptName string, err error, tmpDelay time.Duratio if !s.isRunning() { return -1 } + //lint:ignore SA1019 We want to retry on a bunch of errors here. if ne, ok := err.(net.Error); ok && ne.Temporary() { s.Errorf("Temporary %s Accept Error(%v), sleeping %dms", acceptName, ne, tmpDelay/time.Millisecond) select { diff --git a/server/store.go b/server/store.go index ed5786eb..36d57627 100644 --- a/server/store.go +++ b/server/store.go @@ -372,11 +372,11 @@ const ( func (st StorageType) String() string { switch st { case MemoryStorage: - return strings.Title(memoryStorageString) + return "Memory" case FileStorage: - return strings.Title(fileStorageString) + return "File" case AnyStorage: - return strings.Title(anyStorageString) + return "Any" default: return "Unknown Storage Type" }