diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2022-03-06 16:33:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:33:45 +0800 |
commit | deec3516d53e9a9679128ade0556ccc818a67be1 (patch) | |
tree | b5c1c5d55be05a244180ece0b822e7e35dc68f42 /internal/db/org_team.go | |
parent | 65526f84e1d382ac01b7379f40fc56b2660d1074 (diff) |
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/db/org_team.go')
-rw-r--r-- | internal/db/org_team.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/org_team.go b/internal/db/org_team.go index 216aa0e9..6bdf4253 100644 --- a/internal/db/org_team.go +++ b/internal/db/org_team.go @@ -255,7 +255,7 @@ func IsUsableTeamName(name string) error { // NewTeam creates a record of new team. // It's caller's responsibility to assign organization ID. func NewTeam(t *Team) error { - if len(t.Name) == 0 { + if t.Name == "" { return errors.New("empty team name") } else if t.OrgID == 0 { return errors.New("OrgID is not assigned") @@ -364,7 +364,7 @@ func GetTeamsByOrgID(orgID int64) ([]*Team, error) { // UpdateTeam updates information of team. func UpdateTeam(t *Team, authChanged bool) (err error) { - if len(t.Name) == 0 { + if t.Name == "" { return errors.New("empty team name") } |