I have a small monorepo of Go code (as well as node/js/ts/vue/etc for frontend applications, but that should be irrelevant). There is a single go.mod
in the repo root directory. I’m trying to create GoLand separate projects in submodules of the monorepo, but it seems GoLand isn’t detecting the root go.mod
file. Example file structure:
root/
go.mod -- module named "mymodule"
go.sum
foo/
.idea/
main.go
bar/
.idea/
main.go
libs/
go/
mylib/
mylib.go
In the foo
and bar
submodules/projects, GoLand is 1) reporting 'go.mod' file is absent
, 2) saying it can’t resolve imports from mymodule/libs/go/mylib
. Command-line go
operations (building, getting, etc) are functioning and detecting the root go.mod
properly.
Is there a way to configure GoLand to recognize a project as part of a module from a parent directory?