aboutsummaryrefslogtreecommitdiffstats
path: root/models/org_team.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/org_team.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/org_team.go')
-rw-r--r--models/org_team.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/models/org_team.go b/models/org_team.go
index a3f1eb92a2..6226772b9a 100644
--- a/models/org_team.go
+++ b/models/org_team.go
@@ -61,7 +61,7 @@ func SearchTeam(opts *SearchTeamOptions) ([]*Team, int64, error) {
opts.PageSize = 10
}
- var cond = builder.NewCond()
+ cond := builder.NewCond()
if len(opts.Keyword) > 0 {
lowerKeyword := strings.ToLower(opts.Keyword)
@@ -80,7 +80,6 @@ func SearchTeam(opts *SearchTeamOptions) ([]*Team, int64, error) {
count, err := sess.
Where(cond).
Count(new(Team))
-
if err != nil {
return nil, 0, err
}
@@ -109,7 +108,6 @@ func (t *Team) ColorFormat(s fmt.State) {
t.Name,
log.NewColoredIDValue(t.OrgID),
t.Authorize)
-
}
// GetUnits return a list of available units for a team
@@ -608,7 +606,7 @@ func GetTeamNamesByID(teamIDs []int64) ([]string, error) {
}
// UpdateTeam updates information of team.
-func UpdateTeam(t *Team, authChanged bool, includeAllChanged bool) (err error) {
+func UpdateTeam(t *Team, authChanged, includeAllChanged bool) (err error) {
if len(t.Name) == 0 {
return errors.New("empty team name")
}
@@ -963,7 +961,7 @@ func isUserInTeams(e Engine, userID int64, teamIDs []int64) (bool, error) {
}
// UsersInTeamsCount counts the number of users which are in userIDs and teamIDs
-func UsersInTeamsCount(userIDs []int64, teamIDs []int64) (int64, error) {
+func UsersInTeamsCount(userIDs, teamIDs []int64) (int64, error) {
var ids []int64
if err := x.In("uid", userIDs).In("team_id", teamIDs).
Table("team_user").