Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
(name string)
| 143 | // It returns an error if the asset could not be found or |
| 144 | // could not be loaded. |
| 145 | func Asset(name string) ([]byte, error) { |
| 146 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 147 | if f, ok := _bindata[cannonicalName]; ok { |
| 148 | a, err := f() |
| 149 | if err != nil { |
| 150 | return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) |
| 151 | } |
| 152 | return a.bytes, nil |
| 153 | } |
| 154 | return nil, fmt.Errorf("Asset %s not found", name) |
| 155 | } |
| 156 | |
| 157 | // MustAsset is like Asset but panics when Asset would return an error. |
| 158 | // It simplifies safe initialization of global variables. |
no test coverage detected