mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02: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:
parent
7c11a73833
commit
0ebb45cfe7
207 changed files with 857 additions and 857 deletions
|
@ -95,13 +95,13 @@ func GetIndexerStatus(ctx context.Context, repo *Repository, indexerType RepoInd
|
|||
func UpdateIndexerStatus(ctx context.Context, repo *Repository, indexerType RepoIndexerType, sha string) error {
|
||||
status, err := GetIndexerStatus(ctx, repo, indexerType)
|
||||
if err != nil {
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to getIndexerStatus for repo: %s Error: %v", repo.FullName(), err)
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to getIndexerStatus for repo: %s Error: %w", repo.FullName(), err)
|
||||
}
|
||||
|
||||
if len(status.CommitSha) == 0 {
|
||||
status.CommitSha = sha
|
||||
if err := db.Insert(ctx, status); err != nil {
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to insert repoIndexerStatus for repo: %s Sha: %s Error: %v", repo.FullName(), sha, err)
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to insert repoIndexerStatus for repo: %s Sha: %s Error: %w", repo.FullName(), sha, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ func UpdateIndexerStatus(ctx context.Context, repo *Repository, indexerType Repo
|
|||
_, err = db.GetEngine(ctx).ID(status.ID).Cols("commit_sha").
|
||||
Update(status)
|
||||
if err != nil {
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to update repoIndexerStatus for repo: %s Sha: %s Error: %v", repo.FullName(), sha, err)
|
||||
return fmt.Errorf("UpdateIndexerStatus: Unable to update repoIndexerStatus for repo: %s Sha: %s Error: %w", repo.FullName(), sha, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue