Fix VSCode to work with Golang multi module repo/project

Опубликовано: 05 Октябрь 2024
на канале: Jason Cheung
192
3

In this quick tutorial, I'll guide you through resolving a common issue in VSCode with Golang projects that have multiple sub-modules. If you've ever faced difficulties getting your project to run due to module complications, this step-by-step guide using go.work is here to help.

In my example, I have folders/projects which have their own module files. Trying to run code from the root of the folder doesn't always work as it can't detect the modules/packages to use. Opening only the folder works in VScode but seeing everything at once doesn't always work.

📝 *Timestamps:*
00:00 - Fixing the problem

🔗 *Helpful Links:*
Go.work: https://go.dev/doc/tutorial/workspaces