From 7d447be786a3d8028bee7071495f4a2554adb328 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 1 Apr 2022 22:35:30 +0400 Subject: [PATCH] Initialise playlistFired at definition. --- internal/radio/icecast.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index ded957a..26ef7a7 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -128,7 +128,7 @@ func lastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) { } var playlistWatcher watcher.InotifyWatcher -var playlistFired chan uint32 +var playlistFired chan uint32 = make(chan uint32) var lastPlayedCache []Song var lastPlayedCacheMutex sync.Mutex @@ -143,8 +143,6 @@ func IcecastWatchPlaylist(playlistPath string, lastNSongs int) error { return errors.Wrap(err, "cannot set a playlist to watch") } - playlistFired = make(chan uint32) - playlistWatcher.WatchForMask(playlistFired, watcher.ModMask) go func() {