本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
664B

  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. }
上海开阖软件有限公司 沪ICP备12045867号-1