Contributing to Go open source projects in GitHub
One important thing to mention about Go packaging system is that it needs to have a proper folder structure within the GOPATH. This introduces a small problem when working with GitHub projects. We are used to forking a project, cloning our fork and start working before committing the pull-request to the original project. Wrong!
When you fork a project, you create a new repository on GitHub within your username. If you clone this repository and start working with it, all new import references in the project will point to your repository instead of the original! Imagine the following case in the original repository:
package main import "github.com/original/a_library" [some code]
Then, you make a fork and add a subfolder with a library called a_library/my_library
that you want to use from the main package. The result is going to be the following:
package main import ( "github.com/original/a_library" ...