golang Error: is not in GOROOT
The following errors are reported during operation
PS C:\goproject\src\go_code\chapter10\factory\main> go run main.go
main.go:5:2: package go_code/chapter10/factory/model is not in GOROOT (C:\go\src\go_code\chapter10\factory\model)
The process is as follows
PS C:\goproject\src\go_code\chapter10\factory\main> go run main.go
main.go:5:2: package go_code/chapter10/factory/model is not in GOROOT (C:\go\src\go_code\chapter10\factory\model)
PS C:\goproject\src\go_code\chapter10\factory\main> go env
set GO111MODULE=
PS C:\goproject\src\go_code\chapter10\factory\main> go env -w GO111MODULE=off
PS C:\goproject\src\go_code\chapter10\factory\main> go run main.go
{tom 78.9}
Read More:
- [GO] The entry file under the main package in golang calls other go file functions and appears undefined
- Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used
- [Solved] .\main.go:3:6: missing function body .\main.go:4:1: syntax error: unexpected semicolon or newline be
- Go Language Error: main redeclared in this block [How to Solve]
- [Solved] Error running ‘go build myfir_go_project‘: Cannot run program
- Golang Error: go get github/xxx [How to Fix]
- GO Exception Runnerw.exe: CreateProcess failed with error 21
- [Solved] Go Get Download Dependency Error: is not using a known version control system
- [Solved] cannot find package “go.opentelemetry.io/otel/api/trace“ in any of
- [Solved] VScode Error: build constraints exclude all Go files in syscall\js
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- [Solved] Error: error getting chaincode bytes: ‘go list‘ failed with: cannot find module providing package
- [Solved] go cobra Error: required flag(s) “pkg-name” not set
- Go build package error: TARGET_OS_MAC & IOMasterPort
- package golang.org/x/net/XXX: unrecognized import path “golang.org/x/net/xxx“…
- [Solved] Goland sdk Error: The selected directory is not a valid home for Go SDK
- [Solved] standard_init_linux.go:190: exec user process caused “exec format error“
- How to Solve Docker Run Error: standard_init_linux.go:219: exec user process caused: exec format error
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin