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:
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user