diff options
author | delvh <leon@kske.dev> | 2022-10-24 21:29:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-24 20:29:17 +0100 |
commit | 0ebb45cfe7606adf021ad359d6fbfcefc54360a5 (patch) | |
tree | 541b75d083213e93bbbfadbdc5d560c739543903 /services/repository/files/commit.go | |
parent | 7c11a73833f3aa9783015e5e13871d3c298d3ef6 (diff) | |
download | gitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.tar.gz gitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.zip |
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>
Diffstat (limited to 'services/repository/files/commit.go')
-rw-r--r-- | services/repository/files/commit.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/repository/files/commit.go b/services/repository/files/commit.go index ecd981b5ff..bc5a4c8ed3 100644 --- a/services/repository/files/commit.go +++ b/services/repository/files/commit.go @@ -26,13 +26,13 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato // confirm that commit is exist gitRepo, closer, err := git.RepositoryFromContextOrOpen(ctx, repo.RepoPath()) if err != nil { - return fmt.Errorf("OpenRepository[%s]: %v", repoPath, err) + return fmt.Errorf("OpenRepository[%s]: %w", repoPath, err) } defer closer.Close() if _, err := gitRepo.GetCommit(sha); err != nil { gitRepo.Close() - return fmt.Errorf("GetCommit[%s]: %v", sha, err) + return fmt.Errorf("GetCommit[%s]: %w", sha, err) } gitRepo.Close() @@ -42,7 +42,7 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato SHA: sha, CommitStatus: status, }); err != nil { - return fmt.Errorf("NewCommitStatus[repo_id: %d, user_id: %d, sha: %s]: %v", repo.ID, creator.ID, sha, err) + return fmt.Errorf("NewCommitStatus[repo_id: %d, user_id: %d, sha: %s]: %w", repo.ID, creator.ID, sha, err) } if status.State.IsSuccess() { |