Hi all,
We have a monorepo with a bunch of services in it.
Currently, in Go 1.16, I'm able to build each service using "docker build -" and generating the tar context "by hand" using something like: go list -deps ./services/s1 | sed -n 's#^
github.com/org/monorepo/##p'
It works fine locally (as always) but when I started using Github Actions to run the build script I saw something peculiar: "go list -deps" was downloading packages
After looking around I saw that this is the expected behavior.
Though I would prefer to have a flag so "go list" could work offline, I figure out that using the following command did solved my issue:
GO111MODULE=off go list -deps ./services/s1 2> /dev/null | sed -n 's#^
github.com/org/monorepo/##p'
Setting GO111MODULE to "off" gave me what I want! \o/
But then I remembered that Go 1.16 release notes did mentioned: "Go 1.17 will ignore GO111MODULE"
So, when Go 1.17 arrives I will need another solution.
Do you guys have any idea of a better way of getting the list of local package dependencies for a package (all this only inside that monorepo)?
Cheers,
Dórian