func (ss *ServerList) SetServers(servers ...string) error {
	naddr := make([]net.Addr, len(servers))
	for i, server := range servers {
		if strings.Contains(server, "/") {
			addr, err := net.ResolveUnixAddr("unix", server)
			if err != nil {
				return err
			}
			naddr[i] = newStaticAddr(addr)
		} else {
			tcpaddr, err := net.ResolveTCPAddr("tcp", server)
			if err != nil {
				return err
			}
			naddr[i] = newStaticAddr(tcpaddr)
		}
	}

	ss.mu.Lock()
	defer ss.mu.Unlock()
	ss.addrs = naddr
	ss.available = make([]net.Addr, 0, len(ss.addrs))
	ss.filterAvailable()
	return nil
}
// SetServers changes a ServerList's set of servers at runtime and is
// safe for concurrent use by multiple goroutines.
//
// Each server is given equal weight. A server is given more weight
// if it's listed multiple times.
//
// SetServers returns an error if any of the server names fail to
// resolve. No attempt is made to connect to the server. If any error
// is returned, no changes are made to the ServerList.
SetServers changes a ServerList's set of servers at runtime and is
safe for concurrent use by multiple goroutines.

Each server is given equal weight. A server is given more weight
if it's listed multiple times.

SetServers returns an error if any of the server names fail to
resolve. No attempt is made to connect to the server. If any error
is returned, no changes are made to the ServerList.
// SetServers changes a ServerList ' s set of servers at runtime and is // safe for concurrent use by multiple goroutines . // // Each server is given equal weight . A server is given more weight // if it ' s listed multiple times . // // SetServers returns an error if any of the server names fail to // resolve . No attempt is made to connect to the server . If any error // is returned no changes are made to the ServerList .
func (ss *ServerList) SetServers(servers ...string) error {
	naddr := make([]net.Addr, len(servers))
	for i, server := range servers {
		if strings.Contains(server, "/") {
			addr, err := net.ResolveUnixAddr("unix", server)
			if err != nil {
				return err
			}
			naddr[i] = newStaticAddr(addr)
		} else {
			tcpaddr, err := net.ResolveTCPAddr("tcp", server)
			if err != nil {
				return err
			}
			naddr[i] = newStaticAddr(tcpaddr)
		}
	}
	ss.mu.Lock()
	defer ss.mu.Unlock()
	ss.addrs = naddr
	ss.available = make([]net.Addr, 0, len(ss.addrs))
	ss.filterAvailable()
	return nil
}
func ( ss * ServerList ) SetServers ( servers ... string ) error { naddr := make ( [ ] net . Addr , len ( servers ) ) for i , server := range servers { if strings . Contains ( server , " " ) { addr , err := net . ResolveUnixAddr ( " " , server ) if err != nil { return err } naddr [ i ] = newStaticAddr ( addr ) } else { tcpaddr , err := net . ResolveTCPAddr ( " " , server ) if err != nil { return err } naddr [ i ] = newStaticAddr ( tcpaddr ) } } ss . mu . Lock ( ) defer ss . mu . Unlock ( ) ss . addrs = naddr ss . available = make ( [ ] net . Addr , 0 , len ( ss . addrs ) ) ss . filterAvailable ( ) return nil }
SetServers changes a ServerList's set of servers at runtime and is
safe for concurrent use by multiple goroutines.
SetServers changes a ServerList ' s set of servers at runtime and is safe for concurrent use by multiple goroutines .