Add golangci #6418

Merged
kolaente merged 119 commits from golanci into master 2019-06-12 19:41:29 +00:00
2 changed files with 2 additions and 11 deletions
Showing only changes of commit 5164aa0095 - Show all commits

View File

@ -2516,7 +2516,7 @@ func (repo *Repository) GetUserFork(userID int64) (*Repository, error) {
// CustomAvatarPath returns repository custom avatar file path.
func (repo *Repository) CustomAvatarPath() string {
// Avatar empty by default
if len(repo.Avatar) <= 0 {
if len(repo.Avatar) == 0 {
return ""
}
return filepath.Join(setting.RepositoryAvatarUploadPath, repo.Avatar)
@ -2528,7 +2528,7 @@ func (repo *Repository) CustomAvatarPath() string {
func (repo *Repository) RelAvatarLink() string {
// If no avatar - path is empty
avatarPath := repo.CustomAvatarPath()
if len(avatarPath) <= 0 {
if len(avatarPath) == 0 {
return ""
}
if !com.IsFile(avatarPath) {

View File

@ -631,15 +631,6 @@ func updateBasicProperties(ctx *context.APIContext, opts api.EditRepoOption) err
return nil
}
func unitTypeInTypes(unitType models.UnitType, unitTypes []models.UnitType) bool {
for _, tp := range unitTypes {
if unitType == tp {
return true
}
}
return false
}
// updateRepoUnits updates repo units: Issue settings, Wiki settings, PR settings
func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
owner := ctx.Repo.Owner