Go programmers typically keep all their Go code in a single workspace .
A workspace contains many version control repositories (managed by Git, for example).
Each repository contains one or more packages .
Each package consists of one or more Go source files in a single directory.
The path to a package’s directory determines its import path .
Note that this differs from other programming environments in which every project has a separate workspace and workspaces are closely tied to version control repositories.
Sorry I am confused by the above description. Does this mean all my projects have to be under GOPATH/src? What is the logic behind this. What if I want to separate my projects and I want import to search multiple paths for user packages. How does one do this?
Hi @wyattbiker we can use go modules if you want to keep a particular project in a different directory. But if you do that you loose the chance to import that project as a lib for other projects as go can not search for dependencies from root you can though use go get so that the source is available in the set workspace and use it. If you want to keep different projects separate you can change GOPATH for that workspace. Mostly workspace can be looked as a python env where you have your installed dependencies of a specific version. and place your source in the source dir. Workspace in go also help to keep code organized and not mix with binaries and packages.