clientv3/client.go
func (c *Client) Sync(ctx context.Context) error {
	mresp, err := c.MemberList(ctx)
	if err != nil {
		return err
	}
	var eps []string
	for _, m := range mresp.Members {
		eps = append(eps, m.ClientURLs...)
	}
	c.SetEndpoints(eps...)
	return nil
}
func (c *Client) Sync(ctx context.Context) error {
	mresp, err := c.MemberList(ctx)
	if err != nil {
		return err
	}
	var eps []string
	for _, m := range mresp.Members {
		eps = append(eps, m.ClientURLs...)
	}
	c.SetEndpoints(eps...)
	return nil
}
func ( c * Client ) Sync ( ctx context . Context ) error { mresp , err := c . MemberList ( ctx ) if err != nil { return err } var eps [ ] string for _ , m := range mresp . Members { eps = append ( eps , m . ClientURLs ... ) } c . SetEndpoints ( eps ... ) return nil }
// Sync synchronizes client's endpoints with the known endpoints from the etcd membership.
Sync synchronizes client s endpoints with the known endpoints from the etcd membership .