Run modernise on the project

This will be available in "go fix" within Go 1.26 but in the meantime:

go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
This commit is contained in:
Jacalz
2025-09-17 22:28:16 +02:00
parent ee742cf34e
commit 534a7bfaaf
15 changed files with 26 additions and 38 deletions
+1 -4
View File
@@ -62,10 +62,7 @@ func (a *albumsPageAdapter) Route() controller.Route { return controller.AlbumsR
func (a *albumsPageAdapter) SortOrders() ([]string, int) {
orders := a.mp.AlbumSortOrders()
sortOrder := slices.Index(orders, a.cfg.SortOrder)
if sortOrder < 0 {
sortOrder = 0
}
sortOrder := max(slices.Index(orders, a.cfg.SortOrder), 0)
return util.LocalizeSlice(orders), sortOrder
}
+1 -4
View File
@@ -47,10 +47,7 @@ func (a *artistsPageAdapter) Route() controller.Route { return controller.Artist
func (a *artistsPageAdapter) SortOrders() ([]string, int) {
orders := a.mp.ArtistSortOrders()
sortOrder := slices.Index(orders, a.cfg.SortOrder)
if sortOrder < 0 {
sortOrder = 0
}
sortOrder := max(slices.Index(orders, a.cfg.SortOrder), 0)
return util.LocalizeSlice(orders), sortOrder
}