我正试图调试我的goland应用程序,并有一些问题与启动。json文件。我的应用程序应该运行参数:my_go_app -c path_to_config.
我的发射。Json看起来像:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch my go app",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"args": ["-c /home/roman/projects/myapp/some.json"]
}
]
}
但是当我调试应用程序时,我收到了以下错误:
标记提供但未定义:-c/home/roman/projects/myapp/some.json/tmp/__debug_bin542579318的用法:- c字符串指定配置文件。(默认"config.json"
无需调试,我的应用程序运行成功。
我已经找到问题所在了。json应该是这样的:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch my go app",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"args": ["-c", "/home/roman/projects/myapp/some.json"]
}
]
}