mirror of
https://github.com/caddyserver/xcaddy.git
synced 2024-11-03 07:50:30 +00:00
Support dlv when debug enabled (#81)
* allow dlv when enable debug * add comment * merge two condition * Update builder.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
c8b2d00673
commit
c7959560b5
1 changed files with 4 additions and 1 deletions
|
@ -110,7 +110,10 @@ func (b Builder) Build(ctx context.Context, outputFile string) error {
|
||||||
cmd := buildEnv.newCommand("go", "build",
|
cmd := buildEnv.newCommand("go", "build",
|
||||||
"-o", absOutputFile,
|
"-o", absOutputFile,
|
||||||
)
|
)
|
||||||
if !b.Debug {
|
if b.Debug {
|
||||||
|
// support dlv
|
||||||
|
cmd.Args = append(cmd.Args, "-gcflags", "all=-N -l")
|
||||||
|
} else {
|
||||||
cmd.Args = append(cmd.Args,
|
cmd.Args = append(cmd.Args,
|
||||||
"-ldflags", "-w -s", // trim debug symbols
|
"-ldflags", "-w -s", // trim debug symbols
|
||||||
"-trimpath",
|
"-trimpath",
|
||||||
|
|
Loading…
Reference in a new issue