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
+3 -2
View File
@@ -1,11 +1,12 @@
package browsing
import (
"slices"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/backend"
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/controller"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
@@ -37,7 +38,7 @@ func (a *albumsPageAdapter) Route() controller.Route { return controller.AlbumsR
func (a *albumsPageAdapter) SortOrders() ([]string, string) {
orders := a.mp.AlbumSortOrders()
sortOrder := a.cfg.SortOrder
if !sharedutil.SliceContains(orders, sortOrder) {
if !slices.Contains(orders, sortOrder) {
sortOrder = string(orders[0])
}
return orders, sortOrder