How to proper configure "Go Build" and what are the differences between Run Kind

Viewed 1144

I am new to Go language and also to the IDE GoLand so I am sorry if this is very basic.

I am currently trying to configure Run Kind for package for all my files, the problem is I cannot seem to get the configuration straight, I get this error:

"can't load package: package Course: unknown import path "Course": cannot find module providing package Course"

My GOROOT is the standard in C: and GOPATH is in my directory of workplace with the folders: scr, bin and pkg. Inside scr is course folder with training files for Go.

I have tried to google every option on how to properly configure the go Build configuration, I might be missing to install packages not sure to be honest, I have installed the gotools and everything from golang.org, and tried following the guide from GoLand in JetBrains but no luck in properly configuring package, or Dir options.

I can create a go Build for each file using Run Kind: File, but I want to create one for all the files inside the folder not one each time I want to run one.

Also I have no idea what -i in Go tool arguments means.

1 Answers

I believe what you need to do is simply enable go module integration. Find the setting at File | Settings | Go | Go Modules (vgo). In that panel also make sure Vgo executable is set to your Project SDK. If it's still not working, enabling the vendor experiment option at File | Settings | Go | Build Tags & Vendoring may help. Be sure your project specific settings aren't overriding these values as well.

Related