mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-08 14:04:59 +08: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:
cmd
models
activities
asymkey
auth
db
git
issues
assignees.gocomment.goissue.goissue_list.goissue_user.goissue_xref.golabel.gopull.gopull_list.goreaction.goreview.go
migrations
migrations.gov113.gov115.gov125.gov127.gov128.gov131.gov132.gov134.gov135.gov136.gov138.gov140.gov141.gov145.gov149.gov155.gov156.gov164.gov167.gov170.gov171.gov173.gov174.gov177.gov183.gov184.gov190.gov194.gov195.gov196.gov198.gov200.gov202.gov206.gov210.gov211.gov223.gov227.gov70.gov71.gov72.gov76.gov81.gov85.go
org.goorg_team.goorganization
perm/access
project
repo.gorepo
attachment.goavatar.gocollaboration.gorelease.gorepo.gorepo_indexer.gorepo_list.goupdate.goupload.go
repo_collaboration.gorepo_transfer.gosystem
user.gouser
webhook
modules
avatar
doctor
git
blame.godiff.goerror.goparse_gogit.go
pipeline
repo.gorepo_attribute.gorepo_compare.gorepo_gpg.gorepo_tag.gograceful
hostmatcher
indexer
log
markup
mcaptcha
options
packages/nuget
private
queue
recaptcha
repository
setting
routers
api/v1
web
services
agit
attachment
auth/source
issue
mailer
migrations
org
pull
release
repository
task
user
webhook
wiki
tests/integration
@ -33,7 +33,7 @@ func CatFileBatchCheck(ctx context.Context, shasToCheckReader *io.PipeReader, ca
|
||||
Stdout: catFileCheckWriter,
|
||||
Stderr: stderr,
|
||||
}); err != nil {
|
||||
_ = catFileCheckWriter.CloseWithError(fmt.Errorf("git cat-file --batch-check [%s]: %v - %s", tmpBasePath, err, errbuf.String()))
|
||||
_ = catFileCheckWriter.CloseWithError(fmt.Errorf("git cat-file --batch-check [%s]: %w - %s", tmpBasePath, err, errbuf.String()))
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ func CatFileBatchCheckAllObjects(ctx context.Context, catFileCheckWriter *io.Pip
|
||||
Stderr: stderr,
|
||||
}); err != nil {
|
||||
log.Error("git cat-file --batch-check --batch-all-object [%s]: %v - %s", tmpBasePath, err, errbuf.String())
|
||||
err = fmt.Errorf("git cat-file --batch-check --batch-all-object [%s]: %v - %s", tmpBasePath, err, errbuf.String())
|
||||
err = fmt.Errorf("git cat-file --batch-check --batch-all-object [%s]: %w - %s", tmpBasePath, err, errbuf.String())
|
||||
_ = catFileCheckWriter.CloseWithError(err)
|
||||
errChan <- err
|
||||
}
|
||||
@ -71,7 +71,7 @@ func CatFileBatch(ctx context.Context, shasToBatchReader *io.PipeReader, catFile
|
||||
Stdin: shasToBatchReader,
|
||||
Stderr: stderr,
|
||||
}); err != nil {
|
||||
_ = shasToBatchReader.CloseWithError(fmt.Errorf("git rev-list [%s]: %v - %s", tmpBasePath, err, errbuf.String()))
|
||||
_ = shasToBatchReader.CloseWithError(fmt.Errorf("git rev-list [%s]: %w - %s", tmpBasePath, err, errbuf.String()))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user