Goland uses the package reference configuration in go_module mode and the local package does not recognize the problem

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/modthe dependency packages of your project using go mod in the folder

PtyEVd

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/srcthe relative position from the beginning

  1. Check the go.mod file under your project

  2. The modul name in the first line is the prefix name of your local original package

    wfe1hF

  3. Just modify the references in the project

    import "github.com/user/nameservice/[本地包名/路径]"

Guess you like

Origin blog.csdn.net/weixin_43988498/article/details/114448109