MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
(name string)
| 209 | // MustAsset is like Asset but panics when Asset would return an error. |
| 210 | // It simplifies safe initialization of global variables. |
| 211 | func MustAsset(name string) []byte { |
| 212 | a, err := Asset(name) |
| 213 | if err != nil { |
| 214 | panic("asset: Asset(" + name + "): " + err.Error()) |
| 215 | } |
| 216 | |
| 217 | return a |
| 218 | } |
| 219 | |
| 220 | // AssetInfo loads and returns the asset info for the given name. |
| 221 | // It returns an error if the asset could not be found or |
no test coverage detected