feat: upgrade grpc to 1.46, and remove the deprecated grpc.WithBalancerName (#1820)
This commit is contained in:
@@ -49,7 +49,10 @@ type (
|
||||
// NewClient returns a Client.
|
||||
func NewClient(target string, opts ...ClientOption) (Client, error) {
|
||||
var cli client
|
||||
opts = append([]ClientOption{WithDialOption(grpc.WithBalancerName(p2c.Name))}, opts...)
|
||||
|
||||
svcCfg := fmt.Sprintf(`{"loadBalancingPolicy":"%s"}`, p2c.Name)
|
||||
balancerOpt := WithDialOption(grpc.WithDefaultServiceConfig(svcCfg))
|
||||
opts = append([]ClientOption{balancerOpt}, opts...)
|
||||
if err := cli.dial(target, opts...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user