Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang authored Aug 23, 2023
1 parent 3b90d2b commit cbf0c31
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions models/issues/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,17 @@ const (

// HasRole returns if a role is not none
func (r Role) HasRole() bool {
return r.String() != ""
}

func (r Role) String() string {
return string(r)
return r.Role != ""

Check failure on line 204 in models/issues/comment.go

View workflow job for this annotation

GitHub Actions / backend

r.Role undefined (type Role has no field or method Role)
}

// LocaleString returns the locale string name of the Status
func (r Role) LocaleString(lang translation.Locale) string {
return lang.Tr("repo.issues.role." + r.String())
return lang.Tr("repo.issues.role." + r.Role)

Check failure on line 209 in models/issues/comment.go

View workflow job for this annotation

GitHub Actions / backend

r.Role undefined (type Role has no field or method Role)
}

// LocaleHelper returns the locale string name of the Status
func (r Role) LocaleHelper(lang translation.Locale) string {
return lang.Tr("repo.issues.role." + r.String() + "_helper")
return lang.Tr("repo.issues.role." + r.Role + "_helper")

Check failure on line 214 in models/issues/comment.go

View workflow job for this annotation

GitHub Actions / backend

r.Role undefined (type Role has no field or method Role)
}

// Comment represents a comment in commit and issue page.
Expand Down

0 comments on commit cbf0c31

Please sign in to comment.