Home  >  Article  >  Backend Development  >  Go run configuration gives incorrect permissions to Fleet-based development environment from Space

Go run configuration gives incorrect permissions to Fleet-based development environment from Space

WBOY
WBOYforward
2024-02-09 21:06:08555browse

Go 运行配置为来自 Space 的基于 Fleet 的开发环境提供了错误权限

php editor Baicao introduced that the running configuration of the Go programming language can be achieved through a Fleet-based development environment, and provides the function of error permissions. This configuration can help developers better manage and debug Go programs and improve development efficiency. Using the Fleet-based development environment, developers can easily configure the Go operating environment and obtain error permissions to help them quickly locate and solve problems in the program. The introduction of this feature brings a more convenient and efficient development experience to Go language developers.

Question content

I'm running a fleet-based development environment in space (that's a cool quote, btw). This is a simple go program. If I open a terminal in fleet, I can successfully execute go run cm/server/main.go. But while creating the run configuration, I get permission returned returned (os error 13) error.

My run.json File:

{
  "configurations": [
    {
       "type": "go",
       "name": "localhost",
       "goExecPath": "cmd/server/main.go",
       "buildParams": [],
    },

    ]
}

Error:

Solution

EDIT: The problem is your configuration 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 where you put the main.go file in buildparams.

source

The above is the detailed content of Go run configuration gives incorrect permissions to Fleet-based development environment from Space. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete