MCPcopy
hub / github.com/1Panel-dev/KubePi / MustAsset

Function MustAsset

thirdparty/gotty/server/asset.go:318–325  ·  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

316// MustAsset is like Asset but panics when Asset would return an error.
317// It simplifies safe initialization of global variables.
318func MustAsset(name string) []byte {
319 a, err := Asset(name)
320 if err != nil {
321 panic("asset: Asset(" + name + "): " + err.Error())
322 }
323
324 return a
325}
326
327// AssetInfo loads and returns the asset info for the given name.
328// It returns an error if the asset could not be found or

Callers

nothing calls this directly

Calls 2

AssetFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected