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/' {} \; |