using github.com/pkg/errors & correct some typo mistakes
Signed-off-by: kevinetc123 <kaiwentan@harmonycloud.cn>
This commit is contained in:
parent
660783cb00
commit
fa584958fc
2 changed files with 4 additions and 2 deletions
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/docker/docker/pkg/system"
|
"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
|
// to canonical posix-style path for tar archival. p is relative
|
||||||
// path.
|
// path.
|
||||||
func tarName(p string) (string, error) {
|
func tarName(p string) (string, error) {
|
||||||
|
|
|
@ -8,6 +8,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -175,7 +177,7 @@ func httpGetRequest(client *http.Client, request string) (io.ReadCloser, error)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if resp.StatusCode != 200 {
|
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
|
return resp.Body, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue