diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2021-03-15 02:52:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 19:52:12 +0100 |
commit | 167b0f46ef946fad3ca13976c3b87598f505e2ea (patch) | |
tree | 8b6a4a47a2a0149899b3eb49b296677c2dba4d36 /models/review.go | |
parent | 164e35ead3c1b9b82d4a23644f6fe96652a747eb (diff) | |
download | gitea-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/review.go')
-rw-r--r-- | models/review.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/models/review.go b/models/review.go index 7775fcdf53..702e9634ef 100644 --- a/models/review.go +++ b/models/review.go @@ -175,7 +175,7 @@ type FindReviewOptions struct { } func (opts *FindReviewOptions) toCond() builder.Cond { - var cond = builder.NewCond() + cond := builder.NewCond() if opts.IssueID > 0 { cond = cond.And(builder.Eq{"issue_id": opts.IssueID}) } @@ -334,8 +334,7 @@ func GetCurrentReview(reviewer *User, issue *Issue) (*Review, error) { } // ContentEmptyErr represents an content empty error -type ContentEmptyErr struct { -} +type ContentEmptyErr struct{} func (ContentEmptyErr) Error() string { return "Review content is empty" @@ -355,7 +354,7 @@ func SubmitReview(doer *User, issue *Issue, reviewType ReviewType, content, comm return nil, nil, err } - var official = false + official := false review, err := getCurrentReview(sess, doer, issue) if err != nil { @@ -668,7 +667,7 @@ func AddReviewRequest(issue *Issue, reviewer, doer *User) (*Comment, error) { return comment, sess.Commit() } -//RemoveReviewRequest remove a review request from one reviewer +// RemoveReviewRequest remove a review request from one reviewer func RemoveReviewRequest(issue *Issue, reviewer, doer *User) (*Comment, error) { sess := x.NewSession() defer sess.Close() @@ -780,7 +779,7 @@ func AddTeamReviewRequest(issue *Issue, reviewer *Team, doer *User) (*Comment, e return comment, sess.Commit() } -//RemoveTeamReviewRequest remove a review request from one team +// RemoveTeamReviewRequest remove a review request from one team func RemoveTeamReviewRequest(issue *Issue, reviewer *Team, doer *User) (*Comment, error) { sess := x.NewSession() defer sess.Close() |