Last active
August 29, 2015 14:05
-
-
Save porjo/b331df0b3d7e33c30920 to your computer and use it in GitHub Desktop.
lowercase Golang error messages
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
# Look for instantiations of error using fmt.Errorf or errors.New, where first letter is upper-case. Convert that letter to lowercase. | |
# e.g. | |
# return fmt.Errorf("User... | |
# return errors.New("User... | |
# becomes | |
# return fmt.Errorf("user... | |
# return errors.New("user... | |
find -name '*.go' -exec sed 's/\(\(errors\.New\|fmt\.Errorf\)("\)\([A-Z]\)\(.*\)/\1\l\3\4/' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment