Skip to content

Instantly share code, notes, and snippets.

@prashantv
Last active October 6, 2015 00:49
Show Gist options
  • Save prashantv/fa777aa4b057e393fb8d to your computer and use it in GitHub Desktop.
Save prashantv/fa777aa4b057e393fb8d to your computer and use it in GitHub Desktop.
Migrate TChannel clients from the old import (github.com/uber/tchannel/golang) to the new import (github.com/uber/tchannel-go)
# Get the new tchannel-go repository.
go get -f -u github.com/uber/tchannel-go
# Delete the old tchannel repository to avoid goimports importing it.
rm -rf ${GOPATH}/src/github.com/uber/tchannel
# Rewrite all imports to use the new repository.
for f in `grep --include '*.go' --exclude-dir "Godeps" --exclude-dir "thrift-binaries" --exclude-dir "build_test" "tchannel/golang" -R -l .`
do
echo "Rewriting $f"
sed -i '' -e 's/github.com\/uber\/tchannel\/golang/github.com\/uber\/tchannel-go/g' $f
gofmt -w $f
done
@danqing
Copy link

danqing commented Oct 6, 2015

And this should be run at the root level of your Go service/repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment