summaryrefslogtreecommitdiffstats
path: root/models/userlist.go
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2021-03-15 02:52:12 +0800
committerGitHub <noreply@github.com>2021-03-14 19:52:12 +0100
commit167b0f46ef946fad3ca13976c3b87598f505e2ea (patch)
tree8b6a4a47a2a0149899b3eb49b296677c2dba4d36 /models/userlist.go
parent164e35ead3c1b9b82d4a23644f6fe96652a747eb (diff)
downloadgitea-167b0f46ef946fad3ca13976c3b87598f505e2ea.tar.gz
gitea-167b0f46ef946fad3ca13976c3b87598f505e2ea.zip
chore(models): rewrite code format. (#14754)
* chore: rewrite format. * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: Adjacent parameters with the same type should be grouped together * chore: update format.
Diffstat (limited to 'models/userlist.go')
-rw-r--r--models/userlist.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/userlist.go b/models/userlist.go
index a2a4248482..53e380cd72 100644
--- a/models/userlist.go
+++ b/models/userlist.go
@@ -10,14 +10,14 @@ import (
"code.gitea.io/gitea/modules/log"
)
-//UserList is a list of user.
+// UserList is a list of user.
// This type provide valuable methods to retrieve information for a group of users efficiently.
type UserList []*User
func (users UserList) getUserIDs() []int64 {
userIDs := make([]int64, len(users))
for _, user := range users {
- userIDs = append(userIDs, user.ID) //Considering that user id are unique in the list
+ userIDs = append(userIDs, user.ID) // Considering that user id are unique in the list
}
return userIDs
}
@@ -26,7 +26,7 @@ func (users UserList) getUserIDs() []int64 {
func (users UserList) IsUserOrgOwner(orgID int64) map[int64]bool {
results := make(map[int64]bool, len(users))
for _, user := range users {
- results[user.ID] = false //Set default to false
+ results[user.ID] = false // Set default to false
}
ownerMaps, err := users.loadOrganizationOwners(x, orgID)
if err == nil {
@@ -66,7 +66,7 @@ func (users UserList) loadOrganizationOwners(e Engine, orgID int64) (map[int64]*
func (users UserList) GetTwoFaStatus() map[int64]bool {
results := make(map[int64]bool, len(users))
for _, user := range users {
- results[user.ID] = false //Set default to false
+ results[user.ID] = false // Set default to false
}
tokenMaps, err := users.loadTwoFactorStatus(x)
if err == nil {