mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #11942 from tedyu/client-3-cancel
clientv3: cancel the client if there is no endpoint
This commit is contained in:
commit
747ff75c96
@ -460,7 +460,8 @@ func newClient(cfg *Config) (*Client, error) {
|
||||
client.resolverGroup.SetEndpoints(cfg.Endpoints)
|
||||
|
||||
if len(cfg.Endpoints) < 1 {
|
||||
return nil, fmt.Errorf("at least one Endpoint must is required in client config")
|
||||
client.cancel()
|
||||
return nil, fmt.Errorf("at least one Endpoint is required in client config")
|
||||
}
|
||||
dialEndpoint := cfg.Endpoints[0]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user