Skip to content

Commit

Permalink
chore(internal/kokoro): Update vet.sh staticcheck (#5876)
Browse files Browse the repository at this point in the history
* Remove defunct mock_test.go files
* Fix simple errors in cmd/go-cloud-debug-agent/internal
* Fix simple error in internal/fields/fold.go
* Update staticcheck to Go 1.15
* Remove unused excludes from vet.sh
* Add build tag to internal/pretty/diff_test.go
  • Loading branch information
quartzmo authored Apr 11, 2022
1 parent 74c120a commit b2f1942
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1,101 deletions.
2 changes: 1 addition & 1 deletion cmd/go-cloud-debug-agent/internal/controller/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var newService = func(ctx context.Context, tokenSource oauth2.TokenSource) (serv
if err != nil {
return nil, err
}
s, err := cd.New(httpClient)
s, err := cd.NewService(ctx, option.WithHTTPClient(httpClient))
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/go-cloud-debug-agent/internal/controller/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestDebugletControllerClientLibrary(t *testing.T) {
if err := validateLabels(c, opts); err != nil {
t.Fatalf("Invalid labels:\n%v", err)
}
if list, err = c.List(ctx); err != nil {
if _, err = c.List(ctx); err != nil {
t.Fatal("List:", err)
}
if m.registerCallsSeen != 1 {
Expand All @@ -189,21 +189,21 @@ func TestDebugletControllerClientLibrary(t *testing.T) {
if err = c.Update(ctx, list.Breakpoints[0].Id, &cd.Breakpoint{Id: testBreakpointID, IsFinalState: true}); err != nil {
t.Fatal("Update:", err)
}
if list, err = c.List(ctx); err != nil {
if _, err = c.List(ctx); err != nil {
t.Fatal("List:", err)
}
if m.registerCallsSeen != 1 {
t.Errorf("saw %d Register calls, want 1", m.registerCallsSeen)
}
// The next List call produces an error that should cause a Register call.
if list, err = c.List(ctx); err == nil {
if _, err = c.List(ctx); err == nil {
t.Fatal("List should have returned an error")
}
if m.registerCallsSeen != 2 {
t.Errorf("saw %d Register calls, want 2", m.registerCallsSeen)
}
// The next List call produces an error that should not cause a Register call.
if list, err = c.List(ctx); err == nil {
if _, err = c.List(ctx); err == nil {
t.Fatal("List should have returned an error")
}
if m.registerCallsSeen != 2 {
Expand Down
Loading

0 comments on commit b2f1942

Please sign in to comment.