diff --git a/.travis.yml b/.travis.yml index 73e76d59..5a2c48c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ vm: language: go go: +- 1.17.x - 1.16.x -- 1.15.x addons: apt: packages: @@ -17,11 +17,8 @@ env: - GO111MODULE=off go_import_path: github.com/nats-io/nats-server install: -- go get github.com/nats-io/nats.go/ -- go get github.com/nats-io/nkeys -- go get github.com/nats-io/jwt -- go get -u honnef.co/go/tools/cmd/staticcheck -- go get -u github.com/client9/misspell/cmd/misspell +- GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck@2021.1.2 +- GO111MODULE=on go get github.com/client9/misspell/cmd/misspell@v0.3.4 before_script: - GO_LIST=$(go list ./...) - go build @@ -33,10 +30,10 @@ script: - set -e - if [[ $TRAVIS_TAG ]]; then go test -v -run=TestVersionMatchesTag ./server; fi - if [[ ! $TRAVIS_TAG ]]; then go test -v -run=TestNoRace --failfast -p=1 -timeout 20m ./...; fi -- if [[ ! $TRAVIS_TAG ]]; then if [[ "$TRAVIS_GO_VERSION" =~ 1.15 ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race -p=1 --failfast -timeout 20m ./...; fi; fi +- if [[ ! $TRAVIS_TAG ]]; then if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then ./scripts/cov.sh TRAVIS; else go test -v -race -p=1 --failfast -timeout 20m ./...; fi; fi - set +e after_success: -- if [[ ! $TRAVIS_TAG ]]; then if [[ "$TRAVIS_GO_VERSION" =~ 1.15 ]]; then $HOME/gopath/bin/goveralls -coverprofile=acc.out -service travis-ci; fi; fi +- if [[ ! $TRAVIS_TAG ]]; then if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then $HOME/gopath/bin/goveralls -coverprofile=acc.out -service travis-ci; fi; fi deploy: provider: script diff --git a/conf/fuzz.go b/conf/fuzz.go index 9dce7f7e..99faf999 100644 --- a/conf/fuzz.go +++ b/conf/fuzz.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build gofuzz // +build gofuzz package conf diff --git a/logger/syslog.go b/logger/syslog.go index 4023da88..6b5c429b 100644 --- a/logger/syslog.go +++ b/logger/syslog.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package logger diff --git a/logger/syslog_test.go b/logger/syslog_test.go index 978c8aa6..93f6a5d6 100644 --- a/logger/syslog_test.go +++ b/logger/syslog_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package logger diff --git a/logger/syslog_windows_test.go b/logger/syslog_windows_test.go index 6524c433..ff2cd74f 100644 --- a/logger/syslog_windows_test.go +++ b/logger/syslog_windows_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package logger diff --git a/server/disk_avail.go b/server/disk_avail.go index c7c7f2c6..20bb090a 100644 --- a/server/disk_avail.go +++ b/server/disk_avail.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !windows -// +build !openbsd +//go:build !windows && !openbsd +// +build !windows,!openbsd package server diff --git a/server/disk_avail_openbsd.go b/server/disk_avail_openbsd.go index 1349fe67..1dd4c0d2 100644 --- a/server/disk_avail_openbsd.go +++ b/server/disk_avail_openbsd.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build openbsd // +build openbsd package server diff --git a/server/disk_avail_windows.go b/server/disk_avail_windows.go index 0e057087..4c7cf749 100644 --- a/server/disk_avail_windows.go +++ b/server/disk_avail_windows.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package server diff --git a/server/fuzz.go b/server/fuzz.go index 03f98ad1..86109cd3 100644 --- a/server/fuzz.go +++ b/server/fuzz.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build gofuzz // +build gofuzz package server diff --git a/server/norace_test.go b/server/norace_test.go index 4daf269e..f008f3d8 100644 --- a/server/norace_test.go +++ b/server/norace_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !race // +build !race package server diff --git a/server/pse/pse_freebsd.go b/server/pse/pse_freebsd.go index 849440fc..8884e529 100644 --- a/server/pse/pse_freebsd.go +++ b/server/pse/pse_freebsd.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !amd64 // +build !amd64 package pse diff --git a/server/pse/pse_rumprun.go b/server/pse/pse_rumprun.go index 48e80fca..9f0fb01d 100644 --- a/server/pse/pse_rumprun.go +++ b/server/pse/pse_rumprun.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build rumprun // +build rumprun package pse diff --git a/server/pse/pse_windows.go b/server/pse/pse_windows.go index e159ebb7..5ee9645f 100644 --- a/server/pse/pse_windows.go +++ b/server/pse/pse_windows.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package pse diff --git a/server/pse/pse_windows_test.go b/server/pse/pse_windows_test.go index bae1dd58..8c45fa48 100644 --- a/server/pse/pse_windows_test.go +++ b/server/pse/pse_windows_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package pse diff --git a/server/service.go b/server/service.go index a44cbac3..dd01c970 100644 --- a/server/service.go +++ b/server/service.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package server diff --git a/server/service_test.go b/server/service_test.go index 93f2727e..94daaeb4 100644 --- a/server/service_test.go +++ b/server/service_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package server diff --git a/server/signal.go b/server/signal.go index 2b42d924..f59b424d 100644 --- a/server/signal.go +++ b/server/signal.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package server diff --git a/server/signal_test.go b/server/signal_test.go index 75ee6dad..1f359755 100644 --- a/server/signal_test.go +++ b/server/signal_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package server diff --git a/server/sysmem/mem_bsd.go b/server/sysmem/mem_bsd.go index f62a7d27..ddab47ba 100644 --- a/server/sysmem/mem_bsd.go +++ b/server/sysmem/mem_bsd.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build freebsd || openbsd || dragonfly || netbsd // +build freebsd openbsd dragonfly netbsd package sysmem diff --git a/server/sysmem/mem_darwin.go b/server/sysmem/mem_darwin.go index e5cce831..28944b33 100644 --- a/server/sysmem/mem_darwin.go +++ b/server/sysmem/mem_darwin.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build darwin // +build darwin package sysmem diff --git a/server/sysmem/mem_linux.go b/server/sysmem/mem_linux.go index 6842a157..f4ed0587 100644 --- a/server/sysmem/mem_linux.go +++ b/server/sysmem/mem_linux.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysmem diff --git a/server/sysmem/mem_windows.go b/server/sysmem/mem_windows.go index 8bf88977..cc4c43dc 100644 --- a/server/sysmem/mem_windows.go +++ b/server/sysmem/mem_windows.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package sysmem diff --git a/server/sysmem/sysctl.go b/server/sysmem/sysctl.go index e70e037c..a7fa266a 100644 --- a/server/sysmem/sysctl.go +++ b/server/sysmem/sysctl.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build darwin || freebsd || openbsd || dragonfly || netbsd // +build darwin freebsd openbsd dragonfly netbsd package sysmem diff --git a/test/fanout_test.go b/test/fanout_test.go index fc3aae1d..54c98afb 100644 --- a/test/fanout_test.go +++ b/test/fanout_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !race // +build !race package test diff --git a/test/norace_test.go b/test/norace_test.go index 1e077bb4..871f170d 100644 --- a/test/norace_test.go +++ b/test/norace_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !race // +build !race package test