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

Function MustAsset

assets/assets.go:159–166  ·  view source on GitHub ↗

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

(name string)

Source from the content-addressed store, hash-verified

157// MustAsset is like Asset but panics when Asset would return an error.
158// It simplifies safe initialization of global variables.
159func MustAsset(name string) []byte {
160 a, err := Asset(name)
161 if err != nil {
162 panic("asset: Asset(" + name + "): " + err.Error())
163 }
164
165 return a
166}
167
168// AssetInfo loads and returns the asset info for the given name.
169// It returns an error if the asset could not be found or

Callers

nothing calls this directly

Calls 2

AssetFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected