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
+4 -9
View File
@@ -1,6 +1,7 @@
package sharedutil
import (
"slices"
"testing"
"github.com/dweymouth/supersonic/backend/mediaprovider"
@@ -79,13 +80,7 @@ func Test_ReorderTracks(t *testing.T) {
func tracklistsEqual(t *testing.T, a, b []*mediaprovider.Track) bool {
t.Helper()
if len(a) != len(b) {
return false
}
for i, _ := range a {
if a[i].ID != b[i].ID {
return false
}
}
return true
return slices.EqualFunc(a, b, func(a, b *mediaprovider.Track) bool {
return a.ID == b.ID
})
}