Skip to content

Commit

Permalink
Fix staticcheck reported issues
Browse files Browse the repository at this point in the history
The tool is started with the "-ignore" flag to ignore warning SA2002
which corresponds to invoking t.Fatalf (and the like) in a go routine.
Calling t.Fatalf in a go routine may produce a race condition.
The rationale for ignoring this warning is that if a test executes
the t.Fatalf() line it is that we have a problem either with test
or code that should be fixed.
  • Loading branch information
kozlovic committed Nov 15, 2016
1 parent cd0712c commit 6455292
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ script:
- go vet ./...
- go test -i -race ./...
- go test -v -race ./...
- staticcheck ./...
- staticcheck -ignore="github.com/nats-io/gnatsd/*/*_test.go:SA2002" ./...
after_script:
- if [ "$TRAVIS_GO_VERSION" = "1.7.3" ]; then ./scripts/cov.sh TRAVIS; fi
- if [ "$TRAVIS_GO_VERSION" = "1.7.3" ] && [ "$TRAVIS_TAG" != "" ]; then ./scripts/cross_compile.sh $TRAVIS_TAG; ghr --username nats-io --token $GITHUB_TOKEN --replace $TRAVIS_TAG pkg/; fi
2 changes: 1 addition & 1 deletion test/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ func TestHTTPHost(t *testing.T) {
func createClientConnSubscribeAndPublish(t *testing.T) net.Conn {
cl := createClientConn(t, "localhost", CLIENT_PORT)

send := sendCommand(t, cl)
sendCommand(t, cl)
send, expect := setupConn(t, cl)
expectMsgs := expectMsgsCommand(t, expect)

Expand Down

0 comments on commit 6455292

Please sign in to comment.