mirror of
https://github.com/gogs/gogs.git
synced 2026-05-06 07:16:08 +02:00
autofix: function call can be replaced with helper function (#6805)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
deec3516d5
commit
5afca6ca8e
@@ -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)
|
||||
|
||||
@@ -95,7 +95,7 @@ func renderDirectory(c *context.Context, treeLink string) {
|
||||
c.Data["IsIPythonNotebook"] = true
|
||||
c.Data["RawFileLink"] = c.Repo.RepoLink + "/raw/" + path.Join(c.Repo.BranchName, c.Repo.TreePath, readmeFile.Name())
|
||||
default:
|
||||
p = bytes.Replace(p, []byte("\n"), []byte(`<br>`), -1)
|
||||
p = bytes.ReplaceAll(p, []byte("\n"), []byte(`<br>`))
|
||||
}
|
||||
c.Data["FileContent"] = string(p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user