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/route/repo/issue.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/route/repo/issue.go')
-rw-r--r-- | internal/route/repo/issue.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/route/repo/issue.go b/internal/route/repo/issue.go index 1b64cfe2..5caa16cb 100644 --- a/internal/route/repo/issue.go +++ b/internal/route/repo/issue.go @@ -700,7 +700,7 @@ func UpdateIssueTitle(c *context.Context) { } title := c.QueryTrim("title") - if len(title) == 0 { + if title == "" { c.Status(http.StatusNoContent) return } @@ -903,7 +903,7 @@ func NewComment(c *context.Context, f form.CreateComment) { }() // Fix #321: Allow empty comments, as long as we have attachments. - if len(f.Content) == 0 && len(attachments) == 0 { + if f.Content == "" && len(attachments) == 0 { return } @@ -933,7 +933,7 @@ func UpdateCommentContent(c *context.Context) { oldContent := comment.Content comment.Content = c.Query("content") - if len(comment.Content) == 0 { + if comment.Content == "" { c.JSONSuccess(map[string]interface{}{ "content": "", }) @@ -1127,7 +1127,7 @@ func NewMilestonePost(c *context.Context, f form.CreateMilestone) { return } - if len(f.Deadline) == 0 { + if f.Deadline == "" { f.Deadline = "9999-12-31" } deadline, err := time.ParseInLocation("2006-01-02", f.Deadline, time.Local) @@ -1183,7 +1183,7 @@ func EditMilestonePost(c *context.Context, f form.CreateMilestone) { return } - if len(f.Deadline) == 0 { + if f.Deadline == "" { f.Deadline = "9999-12-31" } deadline, err := time.ParseInLocation("2006-01-02", f.Deadline, time.Local) |