Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

helper.go 664B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. func keysInt64(m map[int64]struct{}) []int64 {
  6. var keys = make([]int64, 0, len(m))
  7. for k := range m {
  8. keys = append(keys, k)
  9. }
  10. return keys
  11. }
  12. func valuesRepository(m map[int64]*Repository) []*Repository {
  13. var values = make([]*Repository, 0, len(m))
  14. for _, v := range m {
  15. values = append(values, v)
  16. }
  17. return values
  18. }
  19. func valuesUser(m map[int64]*User) []*User {
  20. var values = make([]*User, 0, len(m))
  21. for _, v := range m {
  22. values = append(values, v)
  23. }
  24. return values
  25. }