Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing arguments to executable when debugging with Delve

Tags:

go

delve

I would like to pass arguments to the binary file when executing it with dlv

dlv --listen=:5432 exec /mypath/binary --config=config.toml

But when I am doing it I get following error:

Error: unknown flag: --config

How can I pass arguments to binary when using dlv debugger?

like image 338
Rudziankoŭ Avatar asked Apr 19 '18 14:04

Rudziankoŭ


1 Answers

Add -- to tell dlv that all subsequent arguments should be passed verbatim to the binary, without trying to parse them:

dlv --listen=:5432 exec /mypath/binary -- --config=config.toml

See Delve - Getting Started.

like image 60
Tim Cooper Avatar answered Oct 10 '22 06:10

Tim Cooper