Skip to content

Commit

Permalink
chore: fix linting errors (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom authored Feb 13, 2024
1 parent 0b4c342 commit d80715d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}),
)
Expand Down
6 changes: 3 additions & 3 deletions e2e_postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions internal/mock/sqladmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"encoding/json"
"encoding/pem"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"sync"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d80715d

Please sign in to comment.