mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-10-27 22:16:40 +08: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:
@ -41,7 +41,7 @@ func hashAppToken(x *xorm.Engine) error {
|
||||
}
|
||||
|
||||
if err := sess.Sync2(new(AccessToken)); err != nil {
|
||||
return fmt.Errorf("Sync2: %v", err)
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
}
|
||||
|
||||
if err := sess.Commit(); err != nil {
|
||||
@ -79,7 +79,7 @@ func hashAppToken(x *xorm.Engine) error {
|
||||
token.Sha1 = "" // ensure to blank out column in case drop column doesn't work
|
||||
|
||||
if _, err := sess.ID(token.ID).Cols("token_hash, token_salt, token_last_eight, sha1").Update(token); err != nil {
|
||||
return fmt.Errorf("couldn't add in sha1, token_hash, token_salt and token_last_eight: %v", err)
|
||||
return fmt.Errorf("couldn't add in sha1, token_hash, token_salt and token_last_eight: %w", err)
|
||||
}
|
||||
|
||||
}
|
||||
@ -113,7 +113,7 @@ func resyncHashAppTokenWithUniqueHash(x *xorm.Engine) error {
|
||||
return err
|
||||
}
|
||||
if err := sess.Sync2(new(AccessToken)); err != nil {
|
||||
return fmt.Errorf("Sync2: %v", err)
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
}
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user