MCPcopy
hub / github.com/cloudfoundry/cli / MustAsset

Function MustAsset

i18n/resources/i18n_resources.go:297–304  ·  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

295// MustAsset is like Asset but panics when Asset would return an error.
296// It simplifies safe initialization of global variables.
297func MustAsset(name string) []byte {
298 a, err := Asset(name)
299 if err != nil {
300 panic("asset: Asset(" + name + "): " + err.Error())
301 }
302
303 return a
304}
305
306// AssetInfo loads and returns the asset info for the given name.
307// It returns an error if the asset could not be found or

Callers

nothing calls this directly

Calls 2

AssetFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected