运行`go run config`在Fleet-based开发环境中出现权限错误。

huangapple go评论102阅读模式
英文:

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": [],
    },
  ]
}

错误信息:

运行`go run config`在Fleet-based开发环境中出现权限错误。

英文:

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:

运行`go run config`在Fleet-based开发环境中出现权限错误。

答案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>

Source

huangapple
  • 本文由 发表于 2022年12月6日 20:09:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/74702263.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定