0

Problem

I am working on a large project that has so many child projects, and I put them under one folder, let's say folder A, and opened folder A on Goland. Which looked perfect at first, However, the go.mod of each project became all red and I noticed that all dependencies were unresolved...

Question

I marked each child project as "Resource Root", but it didn't help, and to my surprise there was an empty "External Libraries" in the A folder, it has nothing but Go SDK 1.6. But A folder was nothing but a folder for my projects! What can I do to fix these dependencies missing problem?

By the way, the projects are using vendoring.

My Guess

Probably the issue was that I moved all projects from $GOPATH/src to $GOPATH/src/A.

Steve Wu
  • 143
  • 11
  • 4
    Two options: A) Add replace directoves to your go.mod files. B) Wait for Go 1.18 which introduces workspaces via a toplevel go.work file. – Volker Dec 15 '21 at 06:14
  • Does this answer your question? [Multiple modules within the same project](https://stackoverflow.com/questions/55041915/multiple-modules-within-the-same-project) – blackgreen Dec 15 '21 at 22:18

1 Answers1

0

GoLand supports multiple projects in a single folder. You just have to update your IDE.

This should work:enter image description here

And this should work as well: enter image description here

dsha256
  • 230
  • 1
  • 7