1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-16 07:18:37 +00: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:
delvh
2022-10-24 21:29:17 +02:00
committed by GitHub
parent 7c11a73833
commit 0ebb45cfe7
207 changed files with 857 additions and 857 deletions

View File

@@ -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()
}