Skip to content

Spaces in folder names produce compile errors #3934

@RSWilli

Description

@RSWilli

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
* Check your installed extensions to get the version of the VS Code Go extension - 0.50.0

Describe the bug

When the workspace folder is located in a path where any folder has spaces, then the execution of go build will split the arguments and go build fails.

I think the reason is a missing quoting somewhere here

Steps to reproduce the behavior:

  1. Create a folder via mkdir 'Test Folder'
  2. open vscode in this folder
  3. Configure go like:
{
            "name": "Debug",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${workspaceFolder}/main.go",
            "cwd": "${workspaceFolder}",
}

}
4. See error when compiling, for me the executed go build looks like this:

go build -o /home/willi/Test Folder/__debug_bin4003740761 -gcflags all=-N -l .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions