mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 20:20:40 +08:00
cmd/dlv: Change name for binary dlv auto compiles
Prevent conflicts by choosing a name that is extremely unlikely to conflict with any actual package a user may have in their code. Fixes #580
This commit is contained in:
committed by
Alessandro Arzilli
parent
215e13e81b
commit
b9f7dd5008
@ -19,7 +19,7 @@ dlv debug [package]
|
||||
### Options
|
||||
|
||||
```
|
||||
--output string Output path for the binary. (default "debug")
|
||||
--output string Output path for the binary. (default "./__debug_bin")
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
@ -171,7 +171,7 @@ package name and Delve will compile that package instead, and begin a new debug
|
||||
session.`,
|
||||
Run: debugCmd,
|
||||
}
|
||||
debugCommand.Flags().String("output", "debug", "Output path for the binary.")
|
||||
debugCommand.Flags().String("output", "./__debug_bin", "Output path for the binary.")
|
||||
RootCommand.AddCommand(debugCommand)
|
||||
|
||||
// 'exec' subcommand.
|
||||
|
||||
@ -123,7 +123,7 @@ func testOutput(t *testing.T, dlvbin, output string, delveCmds []string) (stdout
|
||||
buildtestdir := filepath.Join(protest.FindFixturesDir(), "buildtest")
|
||||
|
||||
c := []string{dlvbin, "debug"}
|
||||
debugbin := filepath.Join(buildtestdir, "debug")
|
||||
debugbin := filepath.Join(buildtestdir, "__debug_bin")
|
||||
if output != "" {
|
||||
c = append(c, "--output", output)
|
||||
if filepath.IsAbs(output) {
|
||||
|
||||
Reference in New Issue
Block a user