Fix lint/comments

This commit is contained in:
Alex Dadgar
2018-01-25 09:48:52 -08:00
parent fa6c90a807
commit eade7ff4b5
2 changed files with 10 additions and 6 deletions

View File

@@ -52,6 +52,14 @@ type Server struct {
DC string
}
func (s *Server) Copy() *Server {
return &Server{
Addr: s.Addr,
addr: s.addr,
DC: s.DC,
}
}
func (s *Server) String() string {
s.Lock()
defer s.Unlock()
@@ -224,9 +232,7 @@ func (m *Manager) GetServers() Servers {
copy := make([]*Server, 0, len(m.servers))
for _, s := range m.servers {
ns := new(Server)
*ns = *s
copy = append(copy, ns)
copy = append(copy, s.Copy())
}
return copy
@@ -263,8 +269,7 @@ func (m *Manager) RebalanceServers() {
}
if !foundHealthyServer {
m.logger.Printf("[DEBUG] manager: No healthy servers during rebalance, aborting")
return
m.logger.Printf("[DEBUG] manager: No healthy servers during rebalance")
}
return

View File

@@ -44,7 +44,6 @@ func testManager(t *testing.T) (m *Manager) {
func testManagerFailProb(failPct float64) (m *Manager) {
logger := log.New(os.Stderr, "", 0)
logger = log.New(os.Stderr, "", log.LstdFlags)
shutdownCh := make(chan struct{})
m = New(logger, shutdownCh, &fauxConnPool{failPct: failPct})
return m