misc: Upgrade Go to v1.21

Upgrade to 1.21 as 1.20 is now unmaintained.

Most changes are related to the new `slices` package from standard
library, which can replace some existing custom functions.
This commit is contained in:
Michael Manganiello
2024-03-05 09:49:10 -03:00
parent ea1b2f3284
commit 801967a530
19 changed files with 47 additions and 104 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package browsing
import (
"fmt"
"log"
"slices"
"github.com/dweymouth/supersonic/backend"
"github.com/dweymouth/supersonic/backend/mediaprovider"
@@ -183,7 +184,7 @@ func (a *PlaylistPage) doSetNewTrackOrder(op sharedutil.TrackReorderOp) {
ids := a.tracklist.SelectedTrackIDs()
idxs := make([]int, 0, len(ids))
for i, tr := range a.tracks {
if sharedutil.SliceContains(ids, tr.ID) {
if slices.Contains(ids, tr.ID) {
idxs = append(idxs, i)
}
}