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.
This commit is contained in:
Bo-Yi Wu
2021-03-15 02:52:12 +08:00
committed by GitHub
parent 164e35ead3
commit 167b0f46ef
103 changed files with 474 additions and 460 deletions

View File

@ -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 {