fix(build): Go 1.23 maps.Values slices.Collect #371

Merged
jmiller merged 1 commits from dev into main 2026-05-31 16:38:47 +00:00
+3 -2
View File
@@ -13,6 +13,7 @@ import (
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/unit"
user_model "code.mokoconsulting.tech/MokoConsulting/MokoGitea/models/user"
"maps"
"slices"
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/container"
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/optional"
@@ -47,12 +48,12 @@ func (repos RepositoryList) Swap(i, j int) {
// ValuesRepository converts a repository map to a list
func ValuesRepository(m map[int64]*Repository) []*Repository {
return maps.Values(m)
return slices.Collect(maps.Values(m))
}
// RepositoryListOfMap make list from values of map
func RepositoryListOfMap(repoMap map[int64]*Repository) RepositoryList {
return RepositoryList(maps.Values(repoMap))
return RepositoryList(slices.Collect(maps.Values(repoMap)))
}
func (repos RepositoryList) LoadUnits(ctx context.Context) error {