无法让“调试测试”在 VSCode (golang) 中工作

Sam*_*ies 8 testing debugging go visual-studio-code

调试测试可以完美工作,但最近某个时候发生了一些变化,现在却没有(也许是 go 版本升级?)。

调试测试图像

当我单击“调试测试”时,会弹出此错误消息:

启动失败:调试配置无效 - 无法将 bool 解组为字符串类型的“env”

错误是:Failed to launch: invalid debug configuration - cannot unmarshal bool into "env" of type string

我的launch.json看起来不错(同样,这曾经完美地工作过):

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Launch test function",
        "type": "go",
        "request": "launch",
        "mode": "test",
        "program": "${workspaceFolder}",
        "env": {
            "LOG_LEVEL": "debug",
            "LOG_SQL": "false",
            "DATABASE_URL": "postgresql://postgres@localhost:5432/chainlink_test?sslmode=disable",
        },
        "args": ["-v"]
    },
]
Run Code Online (Sandbox Code Playgroud)

}

可能出什么问题了?

sbr*_*rds 0

只是猜测,但这是否是因为 \xe2\x80\x9cLOG_SQL\xe2\x80\x9d 是 \xe2\x80\x9cfalse\xe2\x80\x9d 而不是 false (字符串 vs bool),而它\xe2\x80\x99s尝试将 \xe2\x80\x9cfalse\xe2\x80\x9d 解析为 bool。

\n