using github.com/pkg/errors & correct some typo mistakes

Signed-off-by: kevinetc123 <kaiwentan@harmonycloud.cn>
This commit is contained in:
kevinetc123 2017-02-24 10:37:01 +08:00
parent 660783cb00
commit fa584958fc
2 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/docker/docker/pkg/system"
)
// canonicalTarNameForPath returns platform-specific filepath
// tarName returns platform-specific filepath
// to canonical posix-style path for tar archival. p is relative
// path.
func tarName(p string) (string, error) {

View File

@ -8,6 +8,8 @@ import (
"os"
"time"
"github.com/pkg/errors"
"github.com/urfave/cli"
)
@ -175,7 +177,7 @@ func httpGetRequest(client *http.Client, request string) (io.ReadCloser, error)
return nil, err
}
if resp.StatusCode != 200 {
return nil, fmt.Errorf("%s", resp.Status)
return nil, errors.Errorf("http get failed with status: %s", resp.Status)
}
return resp.Body, nil
}