I’m new to Go and recently accepted a job offer where it’ll be my primary working language. I’ve been reading / watching videos / playing with code for the last few days to be better prepared on my first day.
One thing that I’m having trouble wrapping my head around is how to manage workspaces and packages?
Is there an industry best practice on creating separate workspaces per project vs having one huge workspace with all projects?
Should “global” packages be managed outside of the workspace? For reference – VS Code wants me to install a bunch of extensions that get added as various users under directory “go/src/github.com/”; is it Go convention to house all of these alongside my project directories?
Some light Googling suggested that this is still in debate and that there’s not (yet?) an authoritative styling opinion here. Would love to hear the community’s thoughts!
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.
Being new here, I’m definitely interested in hearing about what other professionals are doing. Is this how you set up your workspace? What do you like and not like about it? TIA!