Why doesn't IntelliJ IDEA import local packages into a Go project?

I use the Idea plugin to work with my project. The structure of my project is as follows:

enter image description here

controller, entity, model, repository, etc. - These are local packages (where you can use another).

Unfortunately, Idea cannot import one local package from another:

enter image description here

enter image description here

Deleted packages are fine.

My project settings:

enter image description here

enter image description here

What am I doing wrong?

+4
source share
2 answers

you need to follow the correct project structure - https://golang.org/doc/code.html

, , GOPATH, ​​ , ~/dev/go

in $GOPATH/go/src , , github, go get github.com/someone/somepackage, $GOPATH/go/src/github.com/someone/somepackage .go `` github.com/someone/somepackage ".

$GOPATH/src, , $GOPATH/src/me/myproject, "me/myproject/entity" "me/myproject/model"

+8

, github , .

.

0

All Articles