Resource returns the given resource, and an error if it didn't succeed.
(url string)
| 140 | |
| 141 | // Resource returns the given resource, and an error if it didn't succeed. |
| 142 | func (formats *Formats) Resource(url string) (Resource, error) { |
| 143 | ext := getExt(url) |
| 144 | if loader, ok := Files.formats[ext]; ok { |
| 145 | return loader.Resource(url) |
| 146 | } |
| 147 | return nil, fmt.Errorf("no `FileLoader` associated with this extension: %q in url %q", ext, url) |
| 148 | } |