Documentation: document passing arguments to the test program (#2459)

Add documentation on how to pass arguments to the program generated by
`dlv test`.

Fixes #2458
This commit is contained in:
Alessandro Arzilli 2021-05-04 21:37:09 +02:00 committed by GitHub
parent c6e52ecf5c
commit 0da1c9a9d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

@ -10,7 +10,11 @@ Compiles a test binary with optimizations disabled and begins a new debug sessio
The test command allows you to begin a new debug session in the context of your
unit tests. By default Delve will debug the tests in the current directory.
Alternatively you can specify a package name, and Delve will debug the tests in
that package instead.
that package instead. Double-dashes `--` can be used to pass arguments to the test program:
dlv test [package] -- -test.v -other-argument
See also: 'go help testflag'.
```
dlv test [package]

@ -253,7 +253,11 @@ or later, -gcflags="-N -l" on earlier versions of Go.`,
The test command allows you to begin a new debug session in the context of your
unit tests. By default Delve will debug the tests in the current directory.
Alternatively you can specify a package name, and Delve will debug the tests in
that package instead.`,
that package instead. Double-dashes ` + "`--`" + ` can be used to pass arguments to the test program:
dlv test [package] -- -test.v -other-argument
See also: 'go help testflag'.`,
Run: testCmd,
}
testCommand.Flags().String("output", "debug.test", "Output path for the binary.")