Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis: add staticcheck #1019

Merged
merged 6 commits into from
May 16, 2017
Merged

travis: add staticcheck #1019

merged 6 commits into from
May 16, 2017

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Dec 12, 2016

staticcheck is a powerful static linter. See https://github.com/dominikh/go-staticcheck.

@iamqizhao

@tamird
Copy link
Contributor Author

tamird commented Dec 12, 2016

OK, this is green.

@tamird
Copy link
Contributor Author

tamird commented Dec 19, 2016

@iamqizhao could you take a look?

@tamird
Copy link
Contributor Author

tamird commented Feb 27, 2017

@menghanl this is rebased and green again.

@tamird
Copy link
Contributor Author

tamird commented Feb 28, 2017

@menghanl ping.

@dfawley
Copy link
Member

dfawley commented May 12, 2017

@tamird, would you mind resolving the conflicts and then re-assigning this to me? We'd like to move ahead with this.

@tamird
Copy link
Contributor Author

tamird commented May 12, 2017

@dfawley Done. I can't reassign to you because my privileges are insufficient.

@dfawley dfawley assigned dfawley and unassigned tamird May 12, 2017
@dfawley dfawley self-requested a review May 12, 2017 22:37
@@ -2844,7 +2845,8 @@ func testStreamsQuotaRecovery(t *testing.T, e env) {
defer wg.Done()
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 314)
if err != nil {
t.Fatal(err)
t.Error(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a te.cancel() here is necessary to avoid a hang in the main goroutine. You could test this by changing it to if err == nil above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would the main goroutine hang? It only waits on the waitgroup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, comment in the wrong place..

@tamird
Copy link
Contributor Author

tamird commented May 15, 2017

@dfawley ping.

@@ -2433,7 +2433,8 @@ func testMetadataStreamingRPC(t *testing.T, e env) {

payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(reqSizes[index]))
if err != nil {
t.Fatal(err)
t.Error(err)
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I meant to leave that comment.

Maybe defer stream.CloseSend() at the top of the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.

@@ -2844,7 +2845,8 @@ func testStreamsQuotaRecovery(t *testing.T, e env) {
defer wg.Done()
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, 314)
if err != nil {
t.Fatal(err)
t.Error(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, comment in the wrong place..

Also only run golint and go vet in Go 1.8, and fix some vet failures.
server.go:824:3: the surrounding loop is unconditionally terminated (SA4004)
test/end2end_test.go:2409:2: the goroutine calls T.Fatal, which must be called in the same goroutine as the test (SA2002)
test/end2end_test.go:2843:3: the goroutine calls T.Fatal, which must be called in the same goroutine as the test (SA2002)
benchmark/benchmark_test.go:85:3: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
clientconn_test.go:299:2: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
The following violations are not fixed, because the code is a mess:

transport/transport_test.go:208:5: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
transport/transport_test.go:220:5: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
transport/transport_test.go:226:5: the goroutine calls T.Fatalf, which must be called in the same goroutine as the test (SA2002)
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dfawley dfawley merged commit 3773797 into grpc:master May 16, 2017
@tamird tamird deleted the staticcheck branch May 16, 2017 00:05
@tamird
Copy link
Contributor Author

tamird commented May 16, 2017

Yay! 🎉

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants