From e1ed9877cc7c370d40d3f7d975a3460d2b1d4bcc Mon Sep 17 00:00:00 2001 From: alessio Date: Wed, 24 Aug 2016 16:11:13 +0200 Subject: [PATCH] install error log --- realize/project.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/realize/project.go b/realize/project.go index 69b37d6..7923d58 100644 --- a/realize/project.go +++ b/realize/project.go @@ -90,20 +90,22 @@ func (p *Project) GoBuild() error { } // GoInstall is an implementation of the "go install" -func (p *Project) GoInstall() error { +func (p *Project) GoInstall() (error, string) { var out bytes.Buffer + var stderr bytes.Buffer err := os.Setenv("GOBIN", filepath.Join(os.Getenv("GOPATH"), "bin")) if err != nil { - return err + return nil, "" } build := exec.Command("go", "install") build.Dir = p.base build.Stdout = &out + build.Stderr = &stderr if err := build.Run(); err != nil { - return err + return err, stderr.String() } - return nil + return nil, "" } // GoFmt is an implementation of the gofmt