GO workspaces – what to checkin to git and also to use git submodules?


This Content is from Stack Overflow. Question asked by Ian Gregson

I have been playing around with go workspaces and everything is working as it should.

Although I am confused about whether I should be commiting the ROOT directory where the go.work is and also if I should, in fact, be committing the go.work.

If this is the case, then I added git submodules.

Although I am not sure if I like this workflow 🙂 I mean, using git submodules.

So I have (directory structure)

root (where go.work is)

  • proj1 (also added to the go.work)
  • proj2 (also added to the go.work)

Here is my go.work in the root

go 1.18

use (

I cannot find any information about this. If we should be managing the “root” then I assume this needs to end up in GIT – but if I don’t want to manage this as some massive MONOREPO then I need to use git submodules.

enter image description here

Or maybe the “root” should never be added to git and we use it locally?

Does anyone have any experience with a good workflow ?

Information seems to thin on the ground, although workspaces is a fairly new addition.

Thanks in advance.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?