建立并运行go项目的分支

Blog article at this link presents the following instructions for contributing to a Go lang project taking into consideration the complications that arise with import paths when you go get a project. I have created a mybranch according to the following instructions, but when I do go build and run the program it is running the master branch, not mybranch. How do I build and run a particular branch? When I do go build and run the program, it's running the code on master branch.

1.Fork the project
2.get the original one go get github.com/creack/termios
3.cd $GOPATH/src/github.com/creack/termios
4.Add the new remote: git remote add gcharmes git@github.com:gcharmes/termios.git
5.Fetch everything from github git fetch --all
6.Checkout in a new branch git checkout -b mybranch
7.7Contribute, as we are on the original checkout, all the paths are correct
8.Commit and push git commit -p && git push gcharmes mybranch
9.Go to github and create the pull request.

The article is for building a PR (pull request) from your fork, not for running go get <yourfork> (since that PR is pubished on a branch).

As the article mention:

Use your fork only as remote placeholder, do not use it locally.

So you push your PR as a dedicated branch to your fork, and make your PR from there.

But a go get <original_repo> won't work until your PR has been accepted and merged on master.