Skip to content

Commit

Permalink
Obey errcheck -blank in test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Nelson committed Dec 16, 2019
1 parent 6c02c80 commit 12395a6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions internal/twirptest/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ func TestClientWithHooks(t *testing.T) {
protoCli := NewHaberdasherProtobufClient(s.URL, &http.Client{}, twirp.WithClientHooks(hooks))
ctx := context.Background()

_, _ = protoCli.MakeHat(ctx, tt.in)
_, err := protoCli.MakeHat(ctx, tt.in)
if tt.wantErrorCalled && err == nil {
t.Error("unexpected nil error")
}
if !tt.wantErrorCalled && err != nil {
t.Errorf("unexpected error: %v", err)
}

if tt.wantRequestPreparedCalled != requestPreparedCalled {
t.Errorf("unexpected value for requestPreparedCalled: got %t, want %t", requestPreparedCalled, tt.wantRequestPreparedCalled)
Expand All @@ -335,7 +341,13 @@ func TestClientWithHooks(t *testing.T) {
errorCalled = false

jsonCli := NewHaberdasherJSONClient(s.URL, &http.Client{}, twirp.WithClientHooks(hooks))
_, _ = jsonCli.MakeHat(ctx, tt.in)
_, err = jsonCli.MakeHat(ctx, tt.in)
if tt.wantErrorCalled && err == nil {
t.Error("unexpected nil error")
}
if !tt.wantErrorCalled && err != nil {
t.Errorf("unexpected error: %v", err)
}

if tt.wantRequestPreparedCalled != requestPreparedCalled {
t.Errorf("unexpected value for requestPreparedCalled: got %t, want %t", requestPreparedCalled, tt.wantRequestPreparedCalled)
Expand Down

0 comments on commit 12395a6

Please sign in to comment.