| // Copyright 2014 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| cmd := exec.Command("go", "run", "-ldflags=-X main.tbd hello -X main.overwrite trumped -X main.nosuchsymbol neverseen", "linkx.go") |
| out, err := cmd.CombinedOutput() |
| want := "hello\ntrumped\n" |
| fmt.Printf("got %q want %q\n", got, want) |
| cmd = exec.Command("go", "run", "-ldflags=-X main.tbd", "linkx.go") |
| _, err = cmd.CombinedOutput() |
| fmt.Println("-X linker flag should not accept keys without values") |