forked from TrueCloudLab/restic
Merge pull request #563 from restic/fix-build-script
Invert go version test for ldflags
This commit is contained in:
commit
e4a9905d6f
1 changed files with 3 additions and 4 deletions
7
build.go
7
build.go
|
@ -264,14 +264,13 @@ 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))
|
||||||
|
|
||||||
v := runtime.Version()
|
if runtime.Version() < "go1.5" {
|
||||||
if strings.HasPrefix(v, "devel") || strings.HasPrefix(v, "go1.5") || strings.HasPrefix(v, "go1.6") || strings.HasPrefix(v, "go1.7") {
|
|
||||||
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 %q %q`, k, v))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for k, v := range cs {
|
for k, v := range cs {
|
||||||
l = append(l, fmt.Sprintf(`-X %q %q`, k, v))
|
l = append(l, fmt.Sprintf(`-X "%s=%s"`, k, v))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue