Home > Software engineering >  Go run config gives error permission for Fleet-based dev environment from Space
Go run config gives error permission for Fleet-based dev environment from Space

Time:12-07

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:

enter image description here

CodePudding user response:

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.


Source

  • Related