()
| 200 | } |
| 201 | |
| 202 | func goPathBinDir() (string, error) { |
| 203 | cmd := exec.Command("go", "env", "GOPATH") |
| 204 | out, err := cmd.Output() |
| 205 | if err != nil { |
| 206 | return "", fmt.Errorf("could not get GOPATH: %v, %s", err, out) |
| 207 | } |
| 208 | paths := filepath.SplitList(strings.TrimSpace(string(out))) |
| 209 | if len(paths) < 1 { |
| 210 | return "", errors.New("no GOPATH") |
| 211 | } |
| 212 | return filepath.Join(paths[0], "bin"), nil |
| 213 | } |
| 214 | |
| 215 | // Create an environment variable of the form key=value. |
| 216 | func envPair(key, value string) string { |