MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
(name string)
| 316 | // MustAsset is like Asset but panics when Asset would return an error. |
| 317 | // It simplifies safe initialization of global variables. |
| 318 | func 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 |