Fixed nested map not being created
parent
6de36a5c66
commit
9b84f4c9ac
3
main.go
3
main.go
|
@ -84,6 +84,9 @@ func Subscribe(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
||||||
|
|
||||||
recv := make(chan []byte)
|
recv := make(chan []byte)
|
||||||
chanId := RandomHex()
|
chanId := RandomHex()
|
||||||
|
if connections[userId] == nil {
|
||||||
|
connections[userId] = make(map[string] chan []byte)
|
||||||
|
}
|
||||||
connections[userId][chanId] = recv
|
connections[userId][chanId] = recv
|
||||||
|
|
||||||
// Refresh connection periodically
|
// Refresh connection periodically
|
||||||
|
|
Loading…
Reference in New Issue