Skip to content

Commit f17b877

Browse files
committed
multi: address linter issues
1 parent e571d6f commit f17b877

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

aperture.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"io"
1010
"net/http"
11+
_ "net/http/pprof" // Blank import to set up profiling HTTP handlers.
1112
"os"
1213
"path/filepath"
1314
"regexp"
@@ -35,12 +36,10 @@ import (
3536
"golang.org/x/net/http2/h2c"
3637
"google.golang.org/grpc"
3738
"google.golang.org/grpc/credentials"
39+
"google.golang.org/grpc/credentials/insecure"
3840
"google.golang.org/grpc/keepalive"
3941
"google.golang.org/protobuf/encoding/protojson"
4042
"gopkg.in/yaml.v2"
41-
42-
// Blank import to set up profiling HTTP handlers.
43-
_ "net/http/pprof"
4443
)
4544

4645
const (
@@ -867,7 +866,9 @@ func createHashMailServer(cfg *Config) ([]proxy.LocalService, func(), error) {
867866
&tls.Config{InsecureSkipVerify: true},
868867
))
869868
if cfg.Insecure {
870-
restProxyTLSOpt = grpc.WithInsecure()
869+
restProxyTLSOpt = grpc.WithTransportCredentials(
870+
insecure.NewCredentials(),
871+
)
871872
}
872873

873874
mux := gateway.NewServeMux(customMarshalerOption)

hashmail_server_test.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/stretchr/testify/assert"
1818
"github.com/stretchr/testify/require"
1919
"google.golang.org/grpc"
20+
"google.golang.org/grpc/credentials/insecure"
2021
"google.golang.org/grpc/test/bufconn"
2122
)
2223

@@ -42,7 +43,11 @@ func TestHashMailServerReturnStream(t *testing.T) {
4243
setupAperture(t)
4344

4445
// Create a client and connect it to the server.
45-
conn, err := grpc.Dial(testApertureAddress, grpc.WithInsecure())
46+
conn, err := grpc.Dial(
47+
testApertureAddress, grpc.WithTransportCredentials(
48+
insecure.NewCredentials(),
49+
),
50+
)
4651
require.NoError(t, err)
4752
client := hashmailrpc.NewHashMailClient(conn)
4853

@@ -114,7 +119,11 @@ func TestHashMailServerLargeMessage(t *testing.T) {
114119
setupAperture(t)
115120

116121
// Create a client and connect it to the server.
117-
conn, err := grpc.Dial(testApertureAddress, grpc.WithInsecure())
122+
conn, err := grpc.Dial(
123+
testApertureAddress, grpc.WithTransportCredentials(
124+
insecure.NewCredentials(),
125+
),
126+
)
118127
require.NoError(t, err)
119128
client := hashmailrpc.NewHashMailClient(conn)
120129

@@ -410,7 +419,7 @@ func (h *hashMailHarness) newClientConn() *grpc.ClientConn {
410419
conn, err := grpc.Dial("bufnet", grpc.WithContextDialer(
411420
func(ctx context.Context, s string) (net.Conn, error) {
412421
return h.lis.Dial()
413-
}), grpc.WithInsecure(),
422+
}), grpc.WithTransportCredentials(insecure.NewCredentials()),
414423
)
415424
require.NoError(h.t, err)
416425
h.t.Cleanup(func() {

pricer/grpcPricer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/lightninglabs/aperture/pricesrpc"
1010
"google.golang.org/grpc"
1111
"google.golang.org/grpc/credentials"
12+
"google.golang.org/grpc/credentials/insecure"
1213
)
1314

1415
// Config holds all the config values required to initialise the GRPCPricer.
@@ -44,7 +45,7 @@ func NewGRPCPricer(cfg *Config) (*GRPCPricer, error) {
4445
)
4546

4647
if cfg.Insecure {
47-
opt = grpc.WithInsecure()
48+
opt = grpc.WithTransportCredentials(insecure.NewCredentials())
4849
} else {
4950
tlsCredentials, err := credentials.NewClientTLSFromFile(
5051
cfg.TLSCertPath, "",

0 commit comments

Comments
 (0)