mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00: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:
		| @@ -125,7 +125,7 @@ func ApplyDiffPatch(ctx context.Context, repo *repo_model.Repository, doer *user | ||||
| 	} else { | ||||
| 		lastCommitID, err := t.gitRepo.ConvertToSHA1(opts.LastCommitID) | ||||
| 		if err != nil { | ||||
| 			return nil, fmt.Errorf("ApplyPatch: Invalid last commit ID: %v", err) | ||||
| 			return nil, fmt.Errorf("ApplyPatch: Invalid last commit ID: %w", err) | ||||
| 		} | ||||
| 		opts.LastCommitID = lastCommitID.String() | ||||
| 		if commit.ID.String() != opts.LastCommitID { | ||||
| @@ -152,7 +152,7 @@ func ApplyDiffPatch(ctx context.Context, repo *repo_model.Repository, doer *user | ||||
| 		Stderr: stderr, | ||||
| 		Stdin:  strings.NewReader(opts.Content), | ||||
| 	}); err != nil { | ||||
| 		return nil, fmt.Errorf("Error: Stdout: %s\nStderr: %s\nErr: %v", stdout.String(), stderr.String(), err) | ||||
| 		return nil, fmt.Errorf("Error: Stdout: %s\nStderr: %s\nErr: %w", stdout.String(), stderr.String(), err) | ||||
| 	} | ||||
|  | ||||
| 	// Now write the tree | ||||
|   | ||||
		Reference in New Issue
	
	Block a user