Browse code

Use fmt.Errorf when appropriate.

Caleb Spare authored on 2013/07/03 06:47:58
Showing 1 changed files
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"archive/tar"
5 5
 	"bufio"
6 6
 	"bytes"
7
-	"errors"
8 7
 	"fmt"
9 8
 	"github.com/dotcloud/docker/utils"
10 9
 	"io"
... ...
@@ -251,7 +250,7 @@ func CmdStream(cmd *exec.Cmd) (io.Reader, error) {
251 251
 		}
252 252
 		errText := <-errChan
253 253
 		if err := cmd.Wait(); err != nil {
254
-			pipeW.CloseWithError(errors.New(err.Error() + ": " + string(errText)))
254
+			pipeW.CloseWithError(fmt.Errorf("%s: %s", err, errText))
255 255
 		} else {
256 256
 			pipeW.Close()
257 257
 		}