Background (win10 environment)
The installed go version is 1.14.3, and the installation path is D/basic_ tool/Go
The version of idea used is 2019.3.3
The configuration path of the system variable root is: D/basic_ tool/Go
The configuration path of the system variable gopath is: e/goprojects
The system variable Gobin value is% root%/bin;% GOPATH%/bin;
The correct configuration path is: D:: basic_ tool\Go\bin %GOROOT%\bin %GOPATH%\bin
On the window command line, enter the following command:
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
Then you can check whether the setting is successful through go env
The configuration path of root and gopath in idea is:
root: D/basic_ Tool/go
gopath: e/goprojects
gopath (global gopath and project gopath)
The configuration parameters of go modules (VGO) in idea are as follows:
Error Description:
The project placement path is: e/goprojects/SRC/xxx/gosvc/example
where gosvc is the name of the project and example is a subdirectory in gosvc, which contains multiple go files and a main.go file. Gosvc package and other packages under gosvc package are imported into main.go
file
The exception is that the gosvce package and the functions in the gosvc package are not recognized in main.go
No go files in D: Basic_ tool\Go\src\gosvc
Solution:
The system variable goproxy is set as shown in the figure below:
Delete the project gopath setting in idea, as shown in the figure below:
Similar Posts:
- Go build Error: cannot find package “fmt” in any of [How to Solve]
- [Solved] Go get Error: “The command you provide is v/v0.9.74.mod, it is not well formed.”
- [Solved] Go Language Error: cannot find module providing package github.com/
- Gopath not set in go command execution
- IDEA double click can’t open no response Issue [How to Solve]
- Can’t use Subversion command line client: svn.
- [Solved] IDEA use SVN Error: Cannot load supported formats: Cannot run program “svn”: CreateProcess error=2
- IntelliJ IDEA: Clone failed runnerw.exe CreateProcess failed with error 2
- How does IntelliJ idea use Maven Tomcat plug to run web projects
- Failed to install node with. MSI, rolling back action (Reprint)