From: Russ Cox Date: Fri, 16 Mar 2012 20:35:16 +0000 (-0400) Subject: cmd/go: don't add detail to errPrintedOutput X-Git-Tag: weekly.2012-03-22~57 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cf0cbfd21a925b39273454c030263b5f9dfab952;p=gostls13.git cmd/go: don't add detail to errPrintedOutput This makes the last error-reporting CL a bit less aggressive. errPrintedOutput is a sentinel value that should not be wrapped. R=gri CC=golang-dev https://golang.org/cl/5845052 --- diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 67b682ecb7..c1833e6075 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -607,7 +607,7 @@ func (b *builder) do(root *action) { // build is the action for building a single package or command. func (b *builder) build(a *action) (err error) { defer func() { - if err != nil { + if err != nil && err != errPrintedOutput { err = fmt.Errorf("go build %s: %v", a.p.ImportPath, err) } }() @@ -761,7 +761,7 @@ func (b *builder) build(a *action) (err error) { // install is the action for installing a single package or executable. func (b *builder) install(a *action) (err error) { defer func() { - if err != nil { + if err != nil && err != errPrintedOutput { err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err) } }()