1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-02 16:35:19 +02:00
Suppress the error when we're removing a file that may not exist
This commit is contained in:
Bwko 2016-12-03 22:31:54 +01:00
parent c8f300b2cd
commit 0118b275b6
2 changed files with 3 additions and 6 deletions

View file

@ -125,9 +125,7 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes
// So we want to make sure the symlink is removed before write anything.
// The new file we created will be in normal text format.
if err := os.Remove(filename); err != nil {
return fmt.Errorf("Fail to remove %s: %v", filename, err)
}
_ = os.Remove(filename)
if err = ioutil.WriteFile(filename, []byte(content), 0666); err != nil {
return fmt.Errorf("WriteFile: %v", err)