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 --- modules/repository/commits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/repository/commits.go') diff --git a/modules/repository/commits.go b/modules/repository/commits.go index c4a69f4a01..7d6eec151f 100644 --- a/modules/repository/commits.go +++ b/modules/repository/commits.go @@ -78,7 +78,7 @@ func (pc *PushCommits) toAPIPayloadCommit(ctx context.Context, repoPath, repoLin fileStatus, err := git.GetCommitFileStatus(ctx, repoPath, commit.Sha1) if err != nil { - return nil, fmt.Errorf("FileStatus [commit_sha1: %s]: %v", commit.Sha1, err) + return nil, fmt.Errorf("FileStatus [commit_sha1: %s]: %w", commit.Sha1, err) } return &api.PayloadCommit{ -- cgit v1.2.3