Skip to content

Commit

Permalink
add //nolint:all
Browse files Browse the repository at this point in the history
Signed-off-by: Angelo De Caro <[email protected]>
  • Loading branch information
adecaro committed Dec 18, 2024
1 parent 1dd67aa commit 8c98495
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package proto

import (
//lint:ignore SA1019 Dependency to be updated to google.golang.org/protobuf/proto
protoV1 "github.com/golang/protobuf/proto"
protoV1 "github.com/golang/protobuf/proto" //nolint:all
)

/*
Expand Down
6 changes: 3 additions & 3 deletions platform/view/services/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ func NewGRPCClient(config ClientConfig) (*Client, error) {
// Unless asynchronous connect is set, make connection establishment blocking.
if !config.AsyncConnect {
//lint:ignore SA1019 Refactor in next change
client.dialOpts = append(client.dialOpts, grpc.WithBlock())
client.dialOpts = append(client.dialOpts, grpc.WithBlock()) //nolint:all
//lint:ignore SA1019 Refactor in next change
client.dialOpts = append(client.dialOpts, grpc.FailOnNonTempDialError(true))
client.dialOpts = append(client.dialOpts, grpc.FailOnNonTempDialError(true)) //nolint:all
}
client.timeout = config.Timeout
// set send/recv message size to package defaults
Expand Down Expand Up @@ -327,7 +327,7 @@ func (client *Client) NewConnection(address string, tlsOptions ...TLSOption) (*g
ctx, cancel := context.WithTimeout(context.Background(), client.timeout)
defer cancel()
//lint:ignore SA1019 Refactor in next change
conn, err := grpc.DialContext(ctx, address, dialOpts...)
conn, err := grpc.DialContext(ctx, address, dialOpts...) //nolint:all
if err != nil {
commLogger.Debugf("failed to create new connection to [%s][%v]: [%s]", address, dialOpts, errors.WithStack(err))
return nil, errors.WithMessage(errors.WithStack(err), "failed to create new connection")
Expand Down
6 changes: 2 additions & 4 deletions platform/view/services/grpc/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ func TestCredentialSupport(t *testing.T) {

creds := cs.GetPeerCredentials()
//lint:ignore SA1019: creds.Info().SecurityVersion is deprecated: please use Peer.AuthInfo.
assert.Equal(t, "1.2", creds.Info().SecurityVersion,
"Expected Security version to be 1.2")
assert.Equal(t, "1.2", creds.Info().SecurityVersion, "Expected Security version to be 1.2") //nolint:all

// append some bad certs and make sure things still work
cs.serverRootCAs = append(cs.serverRootCAs, []byte("badcert"))
cs.serverRootCAs = append(cs.serverRootCAs, []byte(badPEM))
creds = cs.GetPeerCredentials()
//lint:ignore SA1019: creds.Info().SecurityVersion is deprecated: please use Peer.AuthInfo.
assert.Equal(t, "1.2", creds.Info().SecurityVersion,
"Expected Security version to be 1.2")
assert.Equal(t, "1.2", creds.Info().SecurityVersion, "Expected Security version to be 1.2") //nolint:all
}
6 changes: 3 additions & 3 deletions platform/view/services/grpc/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func TestCreds(t *testing.T) {
_, _, err = creds.ClientHandshake(context.Background(), "", nil)
assert.EqualError(t, err, grpc.ErrClientHandshakeNotImplemented.Error())
//lint:ignore SA1019: creds.OverrideServerName is deprecated: use grpc.WithAuthority instead. Will be supported throughout 1.x.
err = creds.OverrideServerName("")
err = creds.OverrideServerName("") //nolint:all
assert.EqualError(t, err, grpc.ErrOverrideHostnameNotSupported.Error())
//lint:ignore SA1019: creds.Info().SecurityVersion is deprecated: please use Peer.AuthInfo.
assert.Equal(t, "1.2", creds.Info().SecurityVersion)
assert.Equal(t, "1.2", creds.Info().SecurityVersion) //nolint:all
assert.Equal(t, "tls", creds.Info().SecurityProtocol)

lis, err := net.Listen("tcp", "localhost:0")
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestAddRootCA(t *testing.T) {
config.AddClientRootCA(cert)

//lint:ignore SA1019: config.Config().ClientCAs.Subjects has been deprecated since Go 1.18: if s was returned by [SystemCertPool], Subjects will not include the system roots.
assert.Equal(t, config.Config().ClientCAs.Subjects(), expectedCertPool.Subjects(), "The CertPools should be equal")
assert.Equal(t, config.Config().ClientCAs.Subjects(), expectedCertPool.Subjects(), "The CertPools should be equal") //nolint:all
}

func TestSetClientCAs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion platform/view/services/grpc/tlsgen/ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestTLSCA(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
//lint:ignore SA1019: grpc.DialContext is deprecated: use NewClient instead. Will be supported throughout 1.x.
conn, err := grpc.DialContext(ctx, listener.Addr().String(), tlsOpts, grpc.WithBlock())
conn, err := grpc.DialContext(ctx, listener.Addr().String(), tlsOpts, grpc.WithBlock()) //nolint:all
if err != nil {
return err
}
Expand Down

0 comments on commit 8c98495

Please sign in to comment.