1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Replace fmt.Errorf() with errors.Errorf() in the cli

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin
2017-03-09 13:23:45 -05:00
parent c1b2fad9aa
commit e9d6193dfd
99 changed files with 370 additions and 337 deletions

View File

@@ -2,8 +2,9 @@ package bundlefile
import (
"encoding/json"
"fmt"
"io"
"github.com/pkg/errors"
)
// Bundlefile stores the contents of a bundlefile
@@ -39,12 +40,12 @@ func LoadFile(reader io.Reader) (*Bundlefile, error) {
if err := decoder.Decode(bundlefile); err != nil {
switch jsonErr := err.(type) {
case *json.SyntaxError:
return nil, fmt.Errorf(
return nil, errors.Errorf(
"JSON syntax error at byte %v: %s",
jsonErr.Offset,
jsonErr.Error())
case *json.UnmarshalTypeError:
return nil, fmt.Errorf(
return nil, errors.Errorf(
"Unexpected type at byte %v. Expected %s but received %s.",
jsonErr.Offset,
jsonErr.Type,