mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +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:
@@ -30,7 +30,7 @@ func addScratchHash(x *xorm.Engine) error {
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(TwoFactor)); err != nil {
|
||||
return fmt.Errorf("Sync2: %v", err)
|
||||
return fmt.Errorf("Sync2: %w", err)
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
@@ -61,7 +61,7 @@ func addScratchHash(x *xorm.Engine) error {
|
||||
tfa.ScratchHash = hashToken(tfa.ScratchToken, salt)
|
||||
|
||||
if _, err := sess.ID(tfa.ID).Cols("scratch_salt, scratch_hash").Update(tfa); err != nil {
|
||||
return fmt.Errorf("couldn't add in scratch_hash and scratch_salt: %v", err)
|
||||
return fmt.Errorf("couldn't add in scratch_hash and scratch_salt: %w", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user