From 96e610e67a463cdf076c83f1ee23c2d7d0008194 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Mon, 27 Mar 2017 18:33:41 -0700 Subject: [PATCH] Do not replace fmt.Errorf in generated file Signed-off-by: Tibor Vass --- compose/schema/bindata.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/compose/schema/bindata.go b/compose/schema/bindata.go index 0c6f8340f4..e6ce0bfec2 100644 --- a/compose/schema/bindata.go +++ b/compose/schema/bindata.go @@ -10,20 +10,19 @@ package schema import ( "bytes" "compress/gzip" + "fmt" "io" "io/ioutil" "os" "path/filepath" "strings" "time" - - "github.com/pkg/errors" ) func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, errors.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer @@ -31,7 +30,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, errors.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err @@ -139,11 +138,11 @@ func Asset(name string) ([]byte, error) { if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { - return nil, errors.Errorf("Asset %s can't read by error: %v", name, err) + return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } - return nil, errors.Errorf("Asset %s not found", name) + return nil, fmt.Errorf("Asset %s not found", name) } // MustAsset is like Asset but panics when Asset would return an error. @@ -165,11 +164,11 @@ func AssetInfo(name string) (os.FileInfo, error) { if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { - return nil, errors.Errorf("AssetInfo %s can't read by error: %v", name, err) + return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } - return nil, errors.Errorf("AssetInfo %s not found", name) + return nil, fmt.Errorf("AssetInfo %s not found", name) } // AssetNames returns the names of the assets. @@ -209,12 +208,12 @@ func AssetDir(name string) ([]string, error) { for _, p := range pathList { node = node.Children[p] if node == nil { - return nil, errors.Errorf("Asset %s not found", name) + return nil, fmt.Errorf("Asset %s not found", name) } } } if node.Func != nil { - return nil, errors.Errorf("Asset %s not found", name) + return nil, fmt.Errorf("Asset %s not found", name) } rv := make([]string, 0, len(node.Children)) for childName := range node.Children { @@ -227,7 +226,6 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } - var _bintree = &bintree{nil, map[string]*bintree{ "data": &bintree{nil, map[string]*bintree{ "config_schema_v3.0.json": &bintree{dataConfig_schema_v30Json, map[string]*bintree{}}, @@ -282,3 +280,4 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } +