data race for streams map

https://go.dev/doc/articles/race_detector
This commit is contained in:
Michele Prà
2024-09-16 12:42:34 +02:00
parent 8399edce6a
commit eb8a13d8c2
+3
View File
@@ -61,6 +61,9 @@ func New(name string, source string) *Stream {
return nil
}
streamsMu.Lock()
defer streamsMu.Unlock()
stream := NewStream(source)
streams[name] = stream
return stream