diff --git a/dialer_test.go b/dialer_test.go index 194a48d4..05244b14 100644 --- a/dialer_test.go +++ b/dialer_test.go @@ -283,7 +283,7 @@ func TestDialerWithCustomDialFunc(t *testing.T) { } d, err := NewDialer(context.Background(), WithTokenSource(mock.EmptyTokenSource{}), - WithDialFunc(func(ctx context.Context, network, addr string) (net.Conn, error) { + WithDialFunc(func(context.Context, string, string) (net.Conn, error) { return nil, errors.New("sentinel error") }), ) diff --git a/e2e_postgres_test.go b/e2e_postgres_test.go index daaa0928..92c4a14d 100644 --- a/e2e_postgres_test.go +++ b/e2e_postgres_test.go @@ -78,7 +78,7 @@ func TestPostgresPgxConnect(t *testing.T) { t.Fatalf("failed to parse pgx config: %v", err) } - config.DialFunc = func(ctx context.Context, network string, instance string) (net.Conn, error) { + config.DialFunc = func(ctx context.Context, _ string, _ string) (net.Conn, error) { return d.Dial(ctx, postgresConnName) } @@ -115,7 +115,7 @@ func TestPostgresConnectWithIAMUser(t *testing.T) { t.Fatalf("failed to initiate Dialer: %v", err) } defer d.Close() - config.DialFunc = func(ctx context.Context, network string, instance string) (net.Conn, error) { + config.DialFunc = func(ctx context.Context, _ string, _ string) (net.Conn, error) { return d.Dial(ctx, postgresConnName) } @@ -326,7 +326,7 @@ func TestPostgresAuthentication(t *testing.T) { t.Fatalf("failed to parse pgx config: %v", err) } - config.DialFunc = func(ctx context.Context, network string, instance string) (net.Conn, error) { + config.DialFunc = func(ctx context.Context, _ string, _ string) (net.Conn, error) { return d.Dial(ctx, postgresConnName) } diff --git a/internal/mock/sqladmin.go b/internal/mock/sqladmin.go index 54f32d47..610312e7 100644 --- a/internal/mock/sqladmin.go +++ b/internal/mock/sqladmin.go @@ -21,7 +21,7 @@ import ( "encoding/json" "encoding/pem" "fmt" - "io/ioutil" + "io" "net/http" "net/http/httptest" "sync" @@ -129,7 +129,7 @@ func InstanceGetSuccess(i FakeCSQLInstance, ct int) *Request { reqMethod: http.MethodGet, reqPath: fmt.Sprintf("/sql/v1beta4/projects/%s/instances/%s/connectSettings", i.project, i.name), reqCt: ct, - handle: func(resp http.ResponseWriter, req *http.Request) { + handle: func(resp http.ResponseWriter, _ *http.Request) { b, err := db.MarshalJSON() if err != nil { http.Error(resp, err.Error(), http.StatusInternalServerError) @@ -154,7 +154,7 @@ func CreateEphemeralSuccess(i FakeCSQLInstance, ct int) *Request { reqCt: ct, handle: func(resp http.ResponseWriter, req *http.Request) { // Read the body from the request. - b, err := ioutil.ReadAll(req.Body) + b, err := io.ReadAll(req.Body) defer req.Body.Close() if err != nil { http.Error(resp, fmt.Errorf("unable to read body: %w", err).Error(), http.StatusBadRequest)