Skip to content

Commit 7fdeb52

Browse files
committed
lint
1 parent 7c3aa0a commit 7fdeb52

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/grpc/grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ import (
2525
event "skywalking.apache.org/repo/goapi/collect/event/v3"
2626

2727
"google.golang.org/grpc"
28+
"google.golang.org/grpc/credentials/insecure"
2829
)
2930

3031
// ReportEvent creates a grpc client and reports an event to OAP.
3132
func ReportEvent(addr string, e *event.Event) (*common.Commands, error) {
32-
conn, err := grpc.Dial(addr, grpc.WithInsecure())
33+
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
3334
if err != nil {
3435
return nil, err
3536
}

pkg/healthcheck/grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"google.golang.org/grpc"
2828
"google.golang.org/grpc/codes"
2929
"google.golang.org/grpc/credentials"
30+
"google.golang.org/grpc/credentials/insecure"
3031
healthpb "google.golang.org/grpc/health/grpc_health_v1"
3132
"google.golang.org/grpc/status"
3233
)
@@ -52,7 +53,7 @@ func HealthCheck(addr string, enableTLS bool) int {
5253
})
5354
opts = append(opts, grpc.WithTransportCredentials(creds))
5455
} else {
55-
opts = append(opts, grpc.WithInsecure())
56+
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
5657
}
5758
dialCtx, cancel := context.WithTimeout(ctx, time.Second)
5859
defer cancel()

0 commit comments

Comments
 (0)