当我从这个项目中休息时,出现了一个奇怪的问题。启动 Goland 后,我在尝试运行我的项目时遇到了很多错误。
start.go: package project/game is not in GOROOT (C:\Go\src\project\game)
C:\Users\username
go
|-src
|-project
|-game
|-entity
|-whatever.go
|-game_stuff.go
|-server
Run Code Online (Sandbox Code Playgroud)
我的环境变量是这样的:
GOROOT=C:\Go
GOPATH=C:\Users\ketchup\go
Run Code Online (Sandbox Code Playgroud)
git mod init
在构建时,Goland 将尝试运行:
C:\Go\bin\go.exe build -o C:\Users\ketchup\AppData\Local\Temp\___go_build_project_server.exe project/server
Run Code Online (Sandbox Code Playgroud)
并返回错误。
谁能帮我解决这个问题?有点迷失,因为我上次打开 Goland 时运行良好。甚至不确定要看什么方向 - 我对 Go 还很陌生,我不确定要看什么文档:\谢谢大家!