fix(lint): golangci-lint warning.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-12-17 22:59:18 +08:00
parent 6fa9769a31
commit fe402a578a
6 changed files with 11 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ import (
"github.com/appleboy/gorush/rpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"
)
@@ -17,7 +18,7 @@ const (
func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithInsecure())
conn, err := grpc.Dial(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("did not connect: %v", err)
}

View File

@@ -8,6 +8,7 @@ import (
structpb "github.com/golang/protobuf/ptypes/struct"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
const (
@@ -16,7 +17,7 @@ const (
func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithInsecure())
conn, err := grpc.Dial(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("did not connect: %v", err)
}

View File

@@ -8,6 +8,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/credentials/insecure"
)
const gRPCAddr = "localhost:9000"
@@ -35,7 +36,7 @@ func TestGracefulShutDownGRPCServer(t *testing.T) {
// gRPC client conn
conn, err := grpc.Dial(
gRPCAddr,
grpc.WithInsecure(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultCallOptions(grpc.WaitForReady(true)),
) // wait for server ready
if err != nil {