0. The project codes are as follows:
The project code is written in gopath/SRC/Demo1/main/main.go
The go build command is executed under the gopath directory
1. The screenshot of error report is as follows: 2
Error reason: the wrong configuration of the root is caused by the FMT package in the error message. It points to F:: (go/bin/SRC) FMT, which indicates that our root is configured as the F:: (go/bin) directory. By default, go goes to the root/SRC directory to find the package directly introduced in our code
2. The solution is to modify the root and change the root to F: 2
After modification, recompile it
Similar Posts:
- Intellij IDEA Golang Error: no Go files in D:\basic_tool\Go\src\gosvc
- Gopath not set in go command execution
- Go build cannot find package Error [How to Solve]
- [Solved] Go Language Error: cannot find module providing package github.com/
- Go Project Start Error: package not in GOROOT & import cycle not allowed
- Android studio change project name exception solution: can’t rename root module
- $GOPATH not set [How to Solve]
- Description of SFTP function error in jumpserver
- Error reporting during spring boot project startup
- Python Attempted relative import in non-package,ImportError: cannot import name ‘xx’ from ‘__main