Skip to content

Instantly share code, notes, and snippets.

@favtuts
Forked from iamucil/go mod rename module.sh
Created March 19, 2023 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save favtuts/6ffd7fe5a791c4f98cd33f5e8c3aaa2b to your computer and use it in GitHub Desktop.
Save favtuts/6ffd7fe5a791c4f98cd33f5e8c3aaa2b to your computer and use it in GitHub Desktop.
go mod edit -module {NEW_MODULE_NAME}
-- rename all imported module
find . -type f -name '*.go' \
-exec sed -i -e 's,{OLD_MODULE},{NEW_MODULE},g' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment