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