mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: cancel the client if there is no endpoint
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
e007d4f58d
commit
dafd474677
@ -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