Created
July 25, 2018 05:55
-
-
Save lysu/9b9c5f6d5376298248d6d0f00d59f43f to your computer and use it in GitHub Desktop.
juju to pkg
This file contains 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
find . -name "*.go" | xargs sed -i 's/github.com\/juju\/errors/github.com\/pkg\/errors/g' | |
find . -name "*.go" | xargs sed -i 's/errors.Trace(/errors.WithStack(/g' | |
find . -name "*.go" | xargs sed -i 's/errors.ErrorStack(\(.*\))/fmt.Sprintf("%+v", \1)/g' | |
find . -name "*.go" | xargs sed -i 's/errors.Wrap(\(.*\), \(.*\))/errors.Wrapf(\2, "%+v", \1)/g' | |
find . -name "*.go" | xargs sed -i 's/errors.Annotate(\(.*\))/errors.Wrap(\1)/g' | |
find . -name "*.go" | xargs sed -i 's/errors.NotFoundf(\(.*\))/errors.Errorf(\1)/g' | |
find . -name "*.go" | xargs sed -i 's/errors.BadRequestf(/errors.Errorf(/g' | |
find . -name "*.go" | xargs sed -i 's/errors.NotSupportedf(/errors.Errorf(/g' | |
find . -name "*.go" | xargs sed -i 's/errors.Annotatef(/errors.Wrapf(/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment