How to add -race argument in launch.json file?
Asked Answered
T

1

3

I debug Go programs in Visual Studio Code. How can I add the -race argument in launch.json file?

I add config in launch.json like below, but it doesn't work.

"args": ["-race"]
Turley answered 16/1, 2019 at 4:17 Comment(3)
Will your Go launch configuration take a "runtimeArgs" key?Lamanna
Yes, I did like "runtimeArgs": ["-race"]. but it doesn't work @LamannaTurley
Did you ever find a solution for it?Photomicrograph
D
1

Adding buildFlags works.

{
    "name": "Launch",
    "type": "go",
    "request": "launch",
    "mode": "auto",
    "program": "${workspaceFolder}",
    "args": [
        ...
    ],
    "buildFlags": [
        "-race"
    ]
}
Diarrhea answered 20/1, 2024 at 9:49 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.