#!/bin/sh -e
#
# gomod-rename - gomod-rename example.com/old/module example.com/new-module
#
# ---
# source: https://github.com/caarlos0/dotfiles

go mod edit -module "${2}"
find . -type f -name '*.go' -exec sed -i'' "s,\"${1}/,\"${2}/,g" {} \;
find . -type f -name '*.go' -exec sed -i'' "s,\"${1}\",\"${2}\",g" {} \;
