Created
April 21, 2022 16:10
-
-
Save jarrpa/c4c2a5a2e7d8ed3a1c997863d262df1b to your computer and use it in GitHub Desktop.
go-module-rename.sh
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
#!/bin/bash | |
set -e | |
OLD_NAME="${1}" | |
NEW_NAME="${2}" | |
go mod edit -module ${NEW_NAME} | |
find . -type f -name '*.go' \ | |
-exec sed -i -e "'s,${OLD_NAME},${NEW_NAME},g'" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment