From 24eb890eb810fa3640202d936f08a7a3b8f98a2e Mon Sep 17 00:00:00 2001 From: Ma Shimiao Date: Fri, 4 Aug 2017 13:24:29 +0800 Subject: [PATCH] remove duplicated error printing Signed-off-by: Ma Shimiao --- cmd/oci-image-tool/create.go | 4 ---- cmd/oci-image-tool/unpack.go | 3 --- image/descriptor.go | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/oci-image-tool/create.go b/cmd/oci-image-tool/create.go index be02286..d9a656b 100644 --- a/cmd/oci-image-tool/create.go +++ b/cmd/oci-image-tool/create.go @@ -68,10 +68,6 @@ func createHandle(context *cli.Context) error { } - if err != nil { - fmt.Printf("creating failed: %v\n", err) - } - return err } diff --git a/cmd/oci-image-tool/unpack.go b/cmd/oci-image-tool/unpack.go index ab5c817..d246d80 100644 --- a/cmd/oci-image-tool/unpack.go +++ b/cmd/oci-image-tool/unpack.go @@ -65,9 +65,6 @@ func unpackHandle(context *cli.Context) error { err = fmt.Errorf("cannot unpack %q", v.typ) } - if err != nil { - fmt.Printf("unpacking failed: %v\n", err) - } return err } diff --git a/image/descriptor.go b/image/descriptor.go index c5ba5ea..fb3ae97 100644 --- a/image/descriptor.go +++ b/image/descriptor.go @@ -76,7 +76,7 @@ func findDescriptor(w walker, name string) (*v1.Descriptor, error) { return nil }); err { case nil: - return nil, fmt.Errorf("index.json: descriptor not found") + return nil, fmt.Errorf("index.json: descriptor %q not found", name) case errEOW: return &d, nil default: