I have installed my project's Go module dependencies with go build
.
But GoLand is telling me it cannot resolve any of these dependencies.
How can I get GoLand to find the Go module dependencies?
To install dependencies, use the go get command, which will also update the go. mod file automatically. Since the package is not currently used anywhere in the project, it's marked as indirect. This comment may also appear on an indirect dependency package; that is, a dependency of another dependency.
Synchronize dependencies from the opened Go fileClick a dependency in the import section, press Alt+Enter and select Sync dependencies.
A Module is a collection of Go packages stored in a file tree under $GOPATH/pkg folder with a go. mod file at its root. This file defines the module's path, which is also the import path used for your project, and its dependency requirements, which are the other modules needed for a successful build.
Make sure that you have Go Modules support enabled.
In your preferences go to Go > Go Modules (vgo)
and check "Enable Go Modules":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With