Allow compile and staticheck to pass.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2022-06-24 09:08:12 -07:00
parent 6b6a2202c7
commit cc197771ec
4 changed files with 8 additions and 7 deletions

View File

@@ -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")

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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"
}