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