MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
(name string)
| 904 | // MustAsset is like Asset but panics when Asset would return an error. |
| 905 | // It simplifies safe initialization of global variables. |
| 906 | func MustAsset(name string) []byte { |
| 907 | a, err := Asset(name) |
| 908 | if err != nil { |
| 909 | panic("asset: Asset(" + name + "): " + err.Error()) |
| 910 | } |
| 911 | |
| 912 | return a |
| 913 | } |
| 914 | |
| 915 | // AssetInfo loads and returns the asset info for the given name. |
| 916 | // It returns an error if the asset could not be found or |