MCPcopy Index your code
hub / github.com/bytesizedhosting/bcd / Asset

Function Asset

plugins/plugin_data.go:892–902  ·  view source on GitHub ↗

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

(name string)

Source from the content-addressed store, hash-verified

890// It returns an error if the asset could not be found or
891// could not be loaded.
892func Asset(name string) ([]byte, error) {
893 cannonicalName := strings.Replace(name, "\\", "/", -1)
894 if f, ok := _bindata[cannonicalName]; ok {
895 a, err := f()
896 if err != nil {
897 return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
898 }
899 return a.bytes, nil
900 }
901 return nil, fmt.Errorf("Asset %s not found", name)
902}
903
904// MustAsset is like Asset but panics when Asset would return an error.
905// It simplifies safe initialization of global variables.

Callers 4

LoadManifestFunction · 0.85
WriteTemplateMethod · 0.85
MustAssetFunction · 0.85
RestoreAssetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected