现象
failed to launch: go version 1.15.6 is too old for this version of delve(minimum supported version 1.16,suppress this error with –check-go-version=false)
解决方法
在 .vscode/launch.json 增加 --check-go-version=false
:
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${file}",
"dlvFlags": [
"--check-go-version=false"
]
}
]
}