etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error

This commit is contained in:
Xiang Li 2015-12-30 11:06:42 -08:00
parent 22c3208fb3
commit cb779b2305

View File

@ -307,8 +307,8 @@ func syncWithPeerAPI(c *cli.Context, ctx context.Context, knownPeers []string) (
}
body, err = ioutil.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
continue
if err == nil {
break
}
}
if err != nil {