mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
chore: use grpc.WithTransportCredentials and insecure.NewCredentials() instead of grpc.WithInsecure (#1798)
Signed-off-by: chenquan <chenquan.dev@gmail.com>
This commit is contained in:
parent
9e20b1bbfe
commit
c6ab11b14f
@ -12,6 +12,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/zrpc/resolver"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -68,7 +69,7 @@ func (c *client) buildDialOptions(opts ...ClientOption) []grpc.DialOption {
|
||||
|
||||
var options []grpc.DialOption
|
||||
if !cliOpts.Secure {
|
||||
options = append([]grpc.DialOption(nil), grpc.WithInsecure())
|
||||
options = append([]grpc.DialOption(nil), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
}
|
||||
|
||||
if !cliOpts.NonBlock {
|
||||
|
Loading…
Reference in New Issue
Block a user