mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551)
Found using
`find . -type f -name '*.go' -print -exec vim {} -c
':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;`
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
			
			
This commit is contained in:
		| @@ -827,12 +827,12 @@ func ChangeUserName(u *User, newUserName string) (err error) { | ||||
| 	} | ||||
|  | ||||
| 	if _, err = db.GetEngine(ctx).Exec("UPDATE `repository` SET owner_name=? WHERE owner_name=?", newUserName, oldUserName); err != nil { | ||||
| 		return fmt.Errorf("Change repo owner name: %v", err) | ||||
| 		return fmt.Errorf("Change repo owner name: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	// Do not fail if directory does not exist | ||||
| 	if err = util.Rename(UserPath(oldUserName), UserPath(newUserName)); err != nil && !os.IsNotExist(err) { | ||||
| 		return fmt.Errorf("Rename user directory: %v", err) | ||||
| 		return fmt.Errorf("Rename user directory: %w", err) | ||||
| 	} | ||||
|  | ||||
| 	if err = NewUserRedirect(ctx, u.ID, oldUserName, newUserName); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user