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:
Derek Parker
2019-05-31 10:26:19 -07:00
committed by Alessandro Arzilli
parent 215e13e81b
commit b9f7dd5008
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ dlv debug [package]
### Options ### 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 ### Options inherited from parent commands

View File

@ -171,7 +171,7 @@ package name and Delve will compile that package instead, and begin a new debug
session.`, session.`,
Run: debugCmd, 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) RootCommand.AddCommand(debugCommand)
// 'exec' subcommand. // 'exec' subcommand.

View File

@ -123,7 +123,7 @@ func testOutput(t *testing.T, dlvbin, output string, delveCmds []string) (stdout
buildtestdir := filepath.Join(protest.FindFixturesDir(), "buildtest") buildtestdir := filepath.Join(protest.FindFixturesDir(), "buildtest")
c := []string{dlvbin, "debug"} c := []string{dlvbin, "debug"}
debugbin := filepath.Join(buildtestdir, "debug") debugbin := filepath.Join(buildtestdir, "__debug_bin")
if output != "" { if output != "" {
c = append(c, "--output", output) c = append(c, "--output", output)
if filepath.IsAbs(output) { if filepath.IsAbs(output) {