MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Asset

Function Asset

assets/assets.go:145–155  ·  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

143// It returns an error if the asset could not be found or
144// could not be loaded.
145func Asset(name string) ([]byte, error) {
146 cannonicalName := strings.Replace(name, "\\", "/", -1)
147 if f, ok := _bindata[cannonicalName]; ok {
148 a, err := f()
149 if err != nil {
150 return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
151 }
152 return a.bytes, nil
153 }
154 return nil, fmt.Errorf("Asset %s not found", name)
155}
156
157// MustAsset is like Asset but panics when Asset would return an error.
158// It simplifies safe initialization of global variables.

Callers 5

NewFunction · 0.92
InjectDevSpaceHelperFunction · 0.92
downloadFileFunction · 0.92
MustAssetFunction · 0.85
RestoreAssetFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected