Exploring the vscode debug process to resolve issues with running Go programs
Problem Description VSCode cannot run Go projects in run mode (it can only debug in debug mode), and the following error occurs. The obscured part in the image is a package within the project, not a third-party package. This means that when running a Go project in run mode, it cannot find other Go files, only the entry file. Initial Investigation The first thought about not finding other files is an issue with the GO_PATH. However, the project uses Go modules, allowing the creation of projects outside the GO_PATH, so this suspicion is ruled out. Next, I suspected an issue with the VSCode configuration. Each VSCode project has a .launch.json file that configures the environment when running code. Below is the .launch.json from the project. ...