To add to the previous answer,
> I've read that GOPATH is the location of my workspace, where all of my
go code belongs (personal project and dependencies of all of these
projects).
yes (so far)
> If I want to push one of my project on github, will I push only my project source code or will I also push the dependencies ?
you might do both, depending on the project.
If you decide to push your deps, they have to be located under vendor folder of the repo.
If you prefer not to push the deps, you might want to try dep
https://github.com/golang/dep/ or glide (glide.sh)
> Can I have two projects using two different version of the same project ?
Yes, if the dependency exists within the vendor folder of each project.
On that subject, remember
- go resolves dependencies by their longest path (might be more complex in some cases, not sure),
- go resolves deps firstly in vendor, then into the WSpace (using above strat)
Welcome !