Skip to content

Instantly share code, notes, and snippets.

@carloscasalar
Forked from iamucil/go mod rename module.sh
Last active March 8, 2025 08:05
Show Gist options
  • Save carloscasalar/661c681cd103c573891ce549b9a1efcb to your computer and use it in GitHub Desktop.
Save carloscasalar/661c681cd103c573891ce549b9a1efcb to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
export CUR="github.com/..."
export NEW="github.com/..."
go mod edit -module ${NEW}
find . -type f -name '*.go' -exec perl -pi -e 's/$ENV{CUR}/$ENV{NEW}/g' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment