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/install.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/install.go')
-rw-r--r-- | internal/route/install.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/route/install.go b/internal/route/install.go index 94c7dd2c..4a529655 100644 --- a/internal/route/install.go +++ b/internal/route/install.go @@ -240,7 +240,7 @@ func InstallPost(c *context.Context, f form.Install) { } // Test repository root path. - f.RepoRootPath = strings.Replace(f.RepoRootPath, "\\", "/", -1) + f.RepoRootPath = strings.ReplaceAll(f.RepoRootPath, "\\", "/") if err := os.MkdirAll(f.RepoRootPath, os.ModePerm); err != nil { c.FormErr("RepoRootPath") c.RenderWithErr(c.Tr("install.invalid_repo_path", err), INSTALL, &f) @@ -248,7 +248,7 @@ func InstallPost(c *context.Context, f form.Install) { } // Test log root path. - f.LogRootPath = strings.Replace(f.LogRootPath, "\\", "/", -1) + f.LogRootPath = strings.ReplaceAll(f.LogRootPath, "\\", "/") if err := os.MkdirAll(f.LogRootPath, os.ModePerm); err != nil { c.FormErr("LogRootPath") c.RenderWithErr(c.Tr("install.invalid_log_root_path", err), INSTALL, &f) |