MCPcopy
hub / github.com/g3n/engine / MustAsset

Function MustAsset

gui/assets/data.go:211–218  ·  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

209// MustAsset is like Asset but panics when Asset would return an error.
210// It simplifies safe initialization of global variables.
211func MustAsset(name string) []byte {
212 a, err := Asset(name)
213 if err != nil {
214 panic("asset: Asset(" + name + "): " + err.Error())
215 }
216
217 return a
218}
219
220// AssetInfo loads and returns the asset info for the given name.
221// It returns an error if the asset could not be found or

Callers 3

InitFunction · 0.92
NewLightStyleFunction · 0.92
NewDarkStyleFunction · 0.92

Calls 2

ErrorMethod · 0.80
AssetFunction · 0.70

Tested by

no test coverage detected