diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2021-03-15 02:52:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 19:52:12 +0100 |
commit | 167b0f46ef946fad3ca13976c3b87598f505e2ea (patch) | |
tree | 8b6a4a47a2a0149899b3eb49b296677c2dba4d36 /models/org.go | |
parent | 164e35ead3c1b9b82d4a23644f6fe96652a747eb (diff) | |
download | gitea-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/org.go')
-rw-r--r-- | models/org.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/org.go b/models/org.go index 437d57d056..3474988efc 100644 --- a/models/org.go +++ b/models/org.go @@ -102,8 +102,8 @@ func FindOrgMembers(opts *FindOrgMembersOpts) (UserList, map[int64]bool, error) return nil, nil, err } - var ids = make([]int64, len(ous)) - var idsIsPublic = make(map[int64]bool, len(ous)) + ids := make([]int64, len(ous)) + idsIsPublic := make(map[int64]bool, len(ous)) for i, ou := range ous { ids[i] = ou.UID idsIsPublic[ou.UID] = ou.IsPublic @@ -205,7 +205,7 @@ func CreateOrganization(org, owner *User) (err error) { } // insert units for team - var units = make([]TeamUnit, 0, len(AllRepoUnitTypes)) + units := make([]TeamUnit, 0, len(AllRepoUnitTypes)) for _, tp := range AllRepoUnitTypes { units = append(units, TeamUnit{ OrgID: org.ID, @@ -437,11 +437,11 @@ func getOwnedOrgsByUserID(sess *xorm.Session, userID int64) ([]*User, error) { } // HasOrgVisible tells if the given user can see the given org -func HasOrgVisible(org *User, user *User) bool { +func HasOrgVisible(org, user *User) bool { return hasOrgVisible(x, org, user) } -func hasOrgVisible(e Engine, org *User, user *User) bool { +func hasOrgVisible(e Engine, org, user *User) bool { // Not SignedUser if user == nil { return org.Visibility == structs.VisibleTypePublic @@ -813,7 +813,7 @@ func (org *User) AccessibleTeamReposEnv(team *Team) AccessibleReposEnvironment { } func (env *accessibleReposEnv) cond() builder.Cond { - var cond = builder.NewCond() + cond := builder.NewCond() if env.team != nil { cond = cond.And(builder.Eq{"team_repo.team_id": env.team.ID}) } else { |