()
| 47 | } |
| 48 | |
| 49 | func (b *builder) Build() error { |
| 50 | args := append([]string{"go", "build", "-o", filepath.Join(b.wd, b.binary)}, b.buildArgs...) |
| 51 | |
| 52 | var command *exec.Cmd |
| 53 | if b.useGodep { |
| 54 | args = append([]string{"godep"}, args...) |
| 55 | } |
| 56 | command = exec.Command(args[0], args[1:]...) |
| 57 | |
| 58 | command.Dir = b.dir |
| 59 | |
| 60 | output, err := command.CombinedOutput() |
| 61 | |
| 62 | if command.ProcessState.Success() { |
| 63 | b.errors = "" |
| 64 | } else { |
| 65 | b.errors = string(output) |
| 66 | } |
| 67 | |
| 68 | if len(b.errors) > 0 { |
| 69 | return fmt.Errorf(b.errors) |
| 70 | } |
| 71 | |
| 72 | return err |
| 73 | } |
nothing calls this directly
no outgoing calls
no test coverage detected