doushi1473 2016-09-29 20:16
浏览 59
已采纳

在子命令和标志中使用delve?

I would like to debug a subcommand (I'm using cobra) but I'm not sure how to test with delve when subcommands and flags are involved.

This is the command that executes the code path I'd like to debug:

./cmd/geronimo/geronimo revalidate --dir configs/ --name revalidate-test

How do I do this with delve?

  • 写回答

1条回答 默认 最新

  • duan19750503 2016-09-29 23:01
    关注

    You can use '--' to separate your arguments from delve's, something like this should do the trick.

    dlv exec ./cmd/geronimo/geronimo -- revalidate --dir configs/ --name revalidate-test
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?