Original post

Assume I’m in a Bash shell with a working directory of ~/projects/foo (which may contain a .mod). How would I build a main module at ~/projects/foo/bar (which also contains a go.mod) given that GO111MODULE=on?

The only way which seems to work (but feels wonky) is (cd foo && go build). Using go1.13.3 on Kubuntu.