Skip to content

Commit d104690

Browse files
authored
Merge pull request #21102 from aojea/SA1019
enable linter for deprecated functions
2 parents 30f9ac5 + 87de854 commit d104690

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+72
-73
lines changed

api/etcdserverpb/raft_internal_stringer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"fmt"
1919
"strings"
2020

21-
proto "github.com/golang/protobuf/proto"
21+
proto "github.com/golang/protobuf/proto" //nolint:staticcheck // TODO: remove for a supported version
2222
)
2323

2424
// InternalRaftStringer implements custom proto Stringer:

client/pkg/transport/timeout_transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewTimeoutTransport(info TLSInfo, dialtimeoutd, rdtimeoutd, wtimeoutd time.
3939
tr.MaxIdleConnsPerHost = 1024
4040
}
4141

42-
tr.Dial = (&rwTimeoutDialer{
42+
tr.Dial = (&rwTimeoutDialer{ //nolint:staticcheck // TODO: remove for a supported version
4343
Dialer: net.Dialer{
4444
Timeout: dialtimeoutd,
4545
KeepAlive: 30 * time.Second,

client/pkg/transport/timeout_transport_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestNewTimeoutTransport(t *testing.T) {
3737
srv := httptest.NewServer(http.HandlerFunc(remoteAddr))
3838

3939
defer srv.Close()
40-
conn, err := tr.Dial("tcp", srv.Listener.Addr().String())
40+
conn, err := tr.Dial("tcp", srv.Listener.Addr().String()) //nolint:staticcheck // TODO: remove for a supported version
4141
require.NoError(t, err)
4242
defer conn.Close()
4343

client/v3/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func (c *Client) dial(creds grpccredentials.TransportCredentials, dopts ...grpc.
331331
defer cancel() // TODO: Is this right for cases where grpc.WithBlock() is not set on the dial options?
332332
}
333333
target := fmt.Sprintf("%s://%p/%s", resolver.Schema, c, authority(c.endpoints[0]))
334-
conn, err := grpc.DialContext(dctx, target, opts...)
334+
conn, err := grpc.DialContext(dctx, target, opts...) //nolint:staticcheck // TODO: remove for a supported version
335335
if err != nil {
336336
return nil, err
337337
}

client/v3/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ func TestDialTimeout(t *testing.T) {
103103
{
104104
Endpoints: []string{"http://254.0.0.1:12345"},
105105
DialTimeout: 2 * time.Second,
106-
DialOptions: []grpc.DialOption{grpc.WithBlock()},
106+
DialOptions: []grpc.DialOption{grpc.WithBlock()}, //nolint:staticcheck // TODO: remove for a supported version
107107
},
108108
{
109109
Endpoints: []string{"http://254.0.0.1:12345"},
110110
DialTimeout: time.Second,
111-
DialOptions: []grpc.DialOption{grpc.WithBlock()},
111+
DialOptions: []grpc.DialOption{grpc.WithBlock()}, //nolint:staticcheck // TODO: remove for a supported version
112112
Username: "abc",
113113
Password: "def",
114114
},

client/v3/naming/resolver/resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func convertToGRPCEndpoint(ups map[string]*endpoints.Update) []gresolver.Endpoin
113113
Addresses: []gresolver.Address{
114114
{
115115
Addr: up.Endpoint.Addr,
116-
Metadata: up.Endpoint.Metadata,
116+
Metadata: up.Endpoint.Metadata, //nolint:staticcheck // TODO: remove for a supported version
117117
},
118118
},
119119
}

server/embed/etcd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ func (e *Etcd) grpcGatewayDial(splitHTTP bool) (grpcDial func(ctx context.Contex
832832
}
833833

834834
return func(ctx context.Context) (*grpc.ClientConn, error) {
835-
conn, err := grpc.DialContext(ctx, addr, opts...)
835+
conn, err := grpc.DialContext(ctx, addr, opts...) //nolint:staticcheck // TODO: remove for a supported version
836836
if err != nil {
837837
sctx.lg.Error("grpc gateway failed to dial", zap.String("addr", addr), zap.Error(err))
838838
return nil, err

server/etcdmain/grpc_proxy_logger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"slices"
2323
"time"
2424

25-
"github.com/golang/protobuf/jsonpb"
26-
"github.com/golang/protobuf/proto"
25+
"github.com/golang/protobuf/jsonpb" //nolint:staticcheck // TODO: remove for a supported version
26+
"github.com/golang/protobuf/proto" //nolint:staticcheck // TODO: remove for a supported version
2727
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors"
2828
"go.uber.org/zap"
2929
"google.golang.org/grpc/peer"

server/etcdserver/api/etcdhttp/types/errors_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func TestHTTPErrorWriteTo(t *testing.T) {
3838
t.Errorf("HTTP status code %d, want %d", rr.Code, wcode)
3939
}
4040

41-
if !reflect.DeepEqual(wheader, rr.HeaderMap) {
42-
t.Errorf("HTTP headers %v, want %v", rr.HeaderMap, wheader)
41+
if !reflect.DeepEqual(wheader, rr.HeaderMap) { //nolint:staticcheck // TODO: remove for a supported version
42+
t.Errorf("HTTP headers %v, want %v", rr.HeaderMap, wheader) //nolint:staticcheck // TODO: remove for a supported version
4343
}
4444

4545
gbody := rr.Body.String()

server/etcdserver/api/etcdhttp/version_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestServeVersion(t *testing.T) {
4545
if g := rw.Body.String(); g != string(w) {
4646
t.Fatalf("body = %q, want %q", g, string(w))
4747
}
48-
if ct := rw.HeaderMap.Get("Content-Type"); ct != "application/json" {
48+
if ct := rw.HeaderMap.Get("Content-Type"); ct != "application/json" { //nolint:staticcheck // TODO: remove for a supported version
4949
t.Errorf("contet-type header = %s, want %s", ct, "application/json")
5050
}
5151
}

0 commit comments

Comments
 (0)