This question already has an answer here:
I am not sure if this behavior is intended, but GoLand appears to NOT auto-import local project packages when referenced.
GoLand has intellisense for the package and package methods. However, after adding the method for a local package, GoLand just complains that it is an "unresolved reference". Until I manually import the package myself.
I have all of my import optimization settings enabled. GoLand auto-imports ALL github and system packages, just not my local project packages.
Is there any way to enable auto-import for local packages? Or must I manually import them myself?
Thank you
</div>
It's not a good practice to use local imports this way. Instead, link to the package through your GOPATH, i.e. github.com/your_github_username/your_project_dir/utilities
.
Assuming project directory:
$GOPATH/
|
src/
|
github.com/
|
your_github_username/
|
your_project_dir/
|utilities
main.go
project: github.com/your_github_username/your_project_dir
package: github.com/your_github_username/your_project_dir/utilities
Following this standard your local package should import without issue.