英文:
Go run config gives error permission for Fleet-based dev environment from Space
问题
我正在运行一个基于Fleet的开发环境(很酷的句子)。这是一个简单的Go程序。如果我在Fleet中打开一个终端,我可以成功执行go run cm/server/main.go
。但是当创建一个运行配置时,我会得到一个permission denied (os error 13)
的错误。
我的run.json
文件:
{
"configurations": [
{
"type": "go",
"name": "localhost",
"goExecPath": "cmd/server/main.go",
"buildParams": [],
},
]
}
错误信息:
英文:
I am running a Fleet-based dev environment from Space (cool sentence btw). It's a simple Go program. If I open a terminal in Fleet, I can successfully execute go run cm/server/main.go
. But when creating a run config, I get a permission denied (os error 13)
error.
My run.json
file:
{
"configurations": [
{
"type": "go",
"name": "localhost",
"goExecPath": "cmd/server/main.go",
"buildParams": [],
},
]
}
The error:
答案1
得分: 2
编辑:问题出在你的配置文件上。
它应该像这样:
{
"configurations": [
{
"type": "go",
"name": "findAverage",
"goExecPath": "/usr/local/go/bin/go",
"buildParams": [
"$PROJECT_DIR$/main.go",
],
"runParams": ["1", "2", "3"]
}
]
}
goExecPath
是 go 可执行文件的路径,你需要将你的 main.go 文件放在 buildParams
中。
英文:
Edit: the issue is your config file.
It needs to look like this:
{
"configurations": [
{
"type": "go",
"name": "findAverage",
"goExecPath": "/usr/local/go/bin/go",
"buildParams": [
"$PROJECT_DIR$/main.go",
],
"runParams": ["1", "2", "3"]
}
]
}
goExecPath
is the path to the go executable, and you put your main.go file in buildParams
.
<hr>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论