aboutsummaryrefslogtreecommitdiffstats
path: root/models/user
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-03 17:04:23 +0800
committerGitHub <noreply@github.com>2022-05-03 17:04:23 +0800
commit772ad761eb4fa88e9912f6bf0eaed65ad3830292 (patch)
treef8355e40773227c47210a19d9b9f9cbfd0ca0d68 /models/user
parentc8ec2261a99590f15699e9147a28e4b61c1c2ea5 (diff)
downloadgitea-772ad761eb4fa88e9912f6bf0eaed65ad3830292.tar.gz
gitea-772ad761eb4fa88e9912f6bf0eaed65ad3830292.zip
Fix some slice problems (incorrect slice length) (#19592)
Diffstat (limited to 'models/user')
-rw-r--r--models/user/list.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user/list.go b/models/user/list.go
index 06ec511375..5cdc92ba4a 100644
--- a/models/user/list.go
+++ b/models/user/list.go
@@ -17,7 +17,7 @@ type UserList []*User //revive:disable-line:exported
// GetUserIDs returns a slice of user's id
func (users UserList) GetUserIDs() []int64 {
- userIDs := make([]int64, len(users))
+ userIDs := make([]int64, 0, len(users))
for _, user := range users {
userIDs = append(userIDs, user.ID) // Considering that user id are unique in the list
}