Some fixes to the previous edit
@@ -316,8 +316,10 @@ func (s *Server) GetTotalConnections() int {
// GetConnections returns all connections
func (s *Server) GetConnections() []Connection {
s.mu.RLock()
- conns:= make([]Connection, len(s.connections))
- copy(conns, s.connections)
+ conns := make([]Connection, len(s.connections), len(s.connections))
+ for i, c := range s.connections {
+ conns[i] = c.value
+ }
s.mu.RUnlock()
return conns
}
