From e93afcdd2bd9578f98508aaad11b695dae29726e Mon Sep 17 00:00:00 2001 From: Caleb Spare Date: Tue, 2 Jul 2013 14:47:58 -0700 Subject: [PATCH] Use fmt.Errorf when appropriate. --- archive.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/archive.go b/archive.go index 357fdd9a7..c9a650cb8 100644 --- a/archive.go +++ b/archive.go @@ -4,7 +4,6 @@ import ( "archive/tar" "bufio" "bytes" - "errors" "fmt" "github.com/dotcloud/docker/utils" "io" @@ -251,7 +250,7 @@ func CmdStream(cmd *exec.Cmd) (io.Reader, error) { } errText := <-errChan if err := cmd.Wait(); err != nil { - pipeW.CloseWithError(errors.New(err.Error() + ": " + string(errText))) + pipeW.CloseWithError(fmt.Errorf("%s: %s", err, errText)) } else { pipeW.Close() }