Answer the question
In order to leave comments, you need to log in
How to correctly set gopath on ubuntu 18?
The import of local files does not work (ala under-inheritance)
go does not pick up local files, as far as I understand this is due to $GOPATH, but whatever I prescribe it still does not want to run or deletes from import or sees but starts with errors.
the project itself is located at /home/user/www/go-test
Answer the question
In order to leave comments, you need to log in
Probably the problem is in the contents of GOPATH. A typical GOPATH includes:
$GOPATH/src/ - for sources
$GOPATH/pkg/ - build binaries
$GOPATH/bin/ - run binaries
Accordingly, you should have the following structure:
$GOPATH/src/go-test
$GOPATH /src/go-test/models
If using your current GOPATH then
/home/user/go/src/go-test
/home/user/go/src/go-test/models
You can now use go version 1.11 with modules and start deprecating GOPATH
https://github.com/golang/go/wiki/Modules
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question