install error log
This commit is contained in:
parent
88981acf51
commit
e1ed9877cc
|
@ -90,20 +90,22 @@ func (p *Project) GoBuild() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GoInstall is an implementation of the "go install"
|
// GoInstall is an implementation of the "go install"
|
||||||
func (p *Project) GoInstall() error {
|
func (p *Project) GoInstall() (error, string) {
|
||||||
var out bytes.Buffer
|
var out bytes.Buffer
|
||||||
|
var stderr bytes.Buffer
|
||||||
err := os.Setenv("GOBIN", filepath.Join(os.Getenv("GOPATH"), "bin"))
|
err := os.Setenv("GOBIN", filepath.Join(os.Getenv("GOPATH"), "bin"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
build := exec.Command("go", "install")
|
build := exec.Command("go", "install")
|
||||||
build.Dir = p.base
|
build.Dir = p.base
|
||||||
build.Stdout = &out
|
build.Stdout = &out
|
||||||
|
build.Stderr = &stderr
|
||||||
if err := build.Run(); err != nil {
|
if err := build.Run(); err != nil {
|
||||||
return err
|
return err, stderr.String()
|
||||||
}
|
}
|
||||||
return nil
|
return nil, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// GoFmt is an implementation of the gofmt
|
// GoFmt is an implementation of the gofmt
|
||||||
|
|
Loading…
Reference in New Issue