Created
February 27, 2025 12:40
-
-
Save alexandear/b72e5932f411dd1fef9e1c4d2e36f2ef to your computer and use it in GitHub Desktop.
Convert github.com/pkg/errors to errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update `errors.Wrapf`: | |
| find . -name "*.go" -exec sed -i '' -E 's/errors\.Wrapf\(([^,]+), "([^"]+)", ([^)]+)\)/fmt.Errorf\("\2: %w", \3, \1\)/g' {} + | |
| # Update `errors.Wrap`: | |
| find . -name "*.go" -exec sed -i '' -E 's/errors\.Wrap\(([^,]+), "([^"]+)"\)/fmt.Errorf\("\2: %w", \1\)/g' {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment