File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
13
13
type SyncServer struct {
14
14
listener net.Listener
15
15
port int
16
- clients map [net.Conn ]bool
16
+ clients map [net.Conn ]struct {}
17
17
clientsMu sync.Mutex
18
18
running bool
19
19
currentSlide int
@@ -30,7 +30,7 @@ func NewSyncServer() (*SyncServer, error) {
30
30
server := & SyncServer {
31
31
listener : listener ,
32
32
port : port ,
33
- clients : make (map [net.Conn ]bool ),
33
+ clients : make (map [net.Conn ]struct {} ),
34
34
currentSlide : 0 ,
35
35
}
36
36
@@ -58,7 +58,7 @@ func (s *SyncServer) Stop() {
58
58
for client := range s .clients {
59
59
client .Close ()
60
60
}
61
- s .clients = make (map [net.Conn ]bool )
61
+ s .clients = make (map [net.Conn ]struct {} )
62
62
s .clientsMu .Unlock ()
63
63
64
64
slog .Info ("Sync server stopped" )
@@ -94,7 +94,7 @@ func (s *SyncServer) acceptConnections() error {
94
94
}
95
95
96
96
s .clientsMu .Lock ()
97
- s .clients [conn ] = true
97
+ s .clients [conn ] = struct {}{}
98
98
s .clientsMu .Unlock ()
99
99
100
100
currentSlide := s .currentSlide
You can’t perform that action at this time.
0 commit comments