MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
(name string)
| 157 | // MustAsset is like Asset but panics when Asset would return an error. |
| 158 | // It simplifies safe initialization of global variables. |
| 159 | func MustAsset(name string) []byte { |
| 160 | a, err := Asset(name) |
| 161 | if err != nil { |
| 162 | panic("asset: Asset(" + name + "): " + err.Error()) |
| 163 | } |
| 164 | |
| 165 | return a |
| 166 | } |
| 167 | |
| 168 | // AssetInfo loads and returns the asset info for the given name. |
| 169 | // It returns an error if the asset could not be found or |