1
0

I found why time was being further altered. The reason is that slices are pointing to original array. Okay. The problem fixed.

This commit is contained in:
Alexander Andreev 2022-04-02 02:00:28 +04:00
parent db8e8c3ebf
commit 1b5dea899e
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -73,7 +73,9 @@ func IcecastLastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error)
if lastNSongs > lpcLen { if lastNSongs > lpcLen {
lastNSongs = lpcLen lastNSongs = lpcLen
} }
return lastPlayedCache[lpcLen-lastNSongs:], nil var ret []Song = make([]Song, lastNSongs)
copy(ret[:], lastPlayedCache[lpcLen-lastNSongs:])
return ret, nil
} }
} }