Published on

How to Import a Golang Forked Repos New Package


I had to work with a forked Go repo today. The problem is that imports in Go are generally of the form where in this case the original repo is hosted on github. In my case I forked this repo so the base repo technically becomes This means that if I added a new package in my fork I would have to import it as The problem is when this is merged the path should then be

After some Googling I came across this answer. The suggested answers did not work too well as the suggested solutions seem to refer more to a forked repo where no new packages are added. The quickest and easiest was what the person asking the question suggested:

git clone [email protected]:some-organisation-or-profile/projectname.git $GOPATH/src/