mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 12:01:35 +08:00
cmd/dlv: do not pass "linkmode internal" for windows on go1.9 and later
go1.9 no longer needs "linkmode internal" on windows. Fixes #755 Fixes #477 Fixes #631
This commit is contained in:
@ -15,6 +15,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/derekparker/delve/pkg/config"
|
||||
"github.com/derekparker/delve/pkg/goversion"
|
||||
"github.com/derekparker/delve/pkg/terminal"
|
||||
"github.com/derekparker/delve/pkg/version"
|
||||
"github.com/derekparker/delve/service"
|
||||
@ -76,8 +77,11 @@ func New(docCall bool) *cobra.Command {
|
||||
conf = config.LoadConfig()
|
||||
buildFlagsDefault := ""
|
||||
if runtime.GOOS == "windows" {
|
||||
// Work-around for https://github.com/golang/go/issues/13154
|
||||
buildFlagsDefault = "-ldflags='-linkmode internal'"
|
||||
ver, _ := goversion.Installed()
|
||||
if ver.Major > 0 && !ver.AfterOrEqual(goversion.GoVersion{1, 9, -1, 0, 0, ""}) {
|
||||
// Work-around for https://github.com/golang/go/issues/13154
|
||||
buildFlagsDefault = "-ldflags='-linkmode internal'"
|
||||
}
|
||||
}
|
||||
|
||||
// Main dlv root command.
|
||||
|
||||
Reference in New Issue
Block a user