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

Viewed 33

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 (
    ./test-work1
    ./test-work2
)

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.

0 Answers
Related