From 0ebb45cfe7606adf021ad359d6fbfcefc54360a5 Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 24 Oct 2022 21:29:17 +0200 Subject: 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 Co-authored-by: wxiaoguang --- models/migrations/v156.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'models/migrations/v156.go') diff --git a/models/migrations/v156.go b/models/migrations/v156.go index 26f97fe984..2c146892d2 100644 --- a/models/migrations/v156.go +++ b/models/migrations/v156.go @@ -123,7 +123,7 @@ func fixPublisherIDforTagReleases(x *xorm.Engine) error { continue } log.Error("Error whilst getting commit for Tag: %s in [%d]%s/%s. Error: %v", release.TagName, repo.ID, repo.OwnerName, repo.Name, err) - return fmt.Errorf("GetTagCommit: %v", err) + return fmt.Errorf("GetTagCommit: %w", err) } if commit.Author.Email == "" { @@ -135,7 +135,7 @@ func fixPublisherIDforTagReleases(x *xorm.Engine) error { continue } log.Error("Error whilst getting commit for Tag: %s in [%d]%s/%s. Error: %v", release.TagName, repo.ID, repo.OwnerName, repo.Name, err) - return fmt.Errorf("GetCommit: %v", err) + return fmt.Errorf("GetCommit: %w", err) } } -- cgit v1.2.3