Goland IDE
goland cannot recognize the dependency package of go mod
Solution: Set GOPROXY in the editor, so goland will identify and index GOPATH/pkg/mod
the dependency packages of your project using go mod in the folder
The use of go mod mode causes the local package to fail to be imported
Because the go module is used for package management, the reference package path is no longer GOPATH/src
the relative position from the beginning
-
Check the go.mod file under your project
-
The modul name in the first line is the prefix name of your local original package
-
Just modify the references in the project
import "github.com/user/nameservice/[本地包名/路径]"