diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2022-03-06 16:33:55 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:33:55 +0800 |
commit | 5afca6ca8eaadebc613dce291da2bae1030ccca9 (patch) | |
tree | 46f86403c6abdeabd6172ee5243caa3bfe5a79a4 /internal/route/repo/editor.go | |
parent | deec3516d53e9a9679128ade0556ccc818a67be1 (diff) |
autofix: function call can be replaced with helper function (#6805)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/route/repo/editor.go')
-rw-r--r-- | internal/route/repo/editor.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/route/repo/editor.go b/internal/route/repo/editor.go index 8f612a98..58536f5b 100644 --- a/internal/route/repo/editor.go +++ b/internal/route/repo/editor.go @@ -268,7 +268,7 @@ func editFilePost(c *context.Context, f form.EditRepoFile, isNewFile bool) { OldTreeName: oldTreePath, NewTreeName: f.TreePath, Message: message, - Content: strings.Replace(f.Content, "\r", "", -1), + Content: strings.ReplaceAll(f.Content, "\r", ""), IsNewFile: isNewFile, }); err != nil { log.Error("Failed to update repo file: %v", err) |