如何将参数传递给 dlv 调试

How do I pass arguments to dlv debug

当我像这样调用 delve 时如何将参数传递给调试程序:dlv debug?我想使用 dlv debug 而不是 dlv exec 因为 dlv exec 并不总能找到所有来源。

根据 dlv --help:

Pass flags to the program you are debugging using `--`, for example:

`dlv exec ./hello -- server --config conf/config.toml`

可以像传递 dlv exec 一样将参数传递给 dlv debug。例如:

dlv debug -- -foo -bar