Also specify new -X syntax for go1.6

This commit is contained in:
Alexander Neumann 2016-01-16 14:08:13 +01:00
parent 7c70d5c1bd
commit 2499bbb09d

View file

@ -256,7 +256,8 @@ type Constants map[string]string
func (cs Constants) LDFlags() string { func (cs Constants) LDFlags() string {
l := make([]string, 0, len(cs)) l := make([]string, 0, len(cs))
if strings.HasPrefix(runtime.Version(), "go1.5") { v := runtime.Version()
if strings.HasPrefix(v, "go1.5") || strings.HasPrefix(v, "go1.6") {
for k, v := range cs { for k, v := range cs {
l = append(l, fmt.Sprintf(`-X "%s=%s"`, k, v)) l = append(l, fmt.Sprintf(`-X "%s=%s"`, k, v))
} }