Created
September 27, 2019 10:33
-
-
Save gonzaloserrano/a33e02760d7f5940ca7c9ebad245eb67 to your computer and use it in GitHub Desktop.
Gorename the ez "easy" way
This file contains hidden or 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 | |
# makes gorename work with relative pkg paths | |
command -v gorename >/dev/null 2>&1 || { echo >&2 "I require gorename to run. Install with go get golang.org/x/tools/cmd/gorename. Aborting."; exit 1; } | |
if [ $# -ne 2 ]; then | |
echo >&2 "I require two args: origin symbol and destination symbol. Aborting." | |
exit 1 | |
fi | |
PWD=$(pwd) | |
PWD=${PWD#"$GOPATH"} | |
PWD=${PWD:5} | |
GO111MODULE=off gorename -from \"$PWD\".$1 -to $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment