getExt returns the extension of the file(including extensions with `.` in them) from the given url.
(path string)
| 74 | |
| 75 | // getExt returns the extension of the file(including extensions with `.` in them) from the given url. |
| 76 | func getExt(path string) string { |
| 77 | ext := "" |
| 78 | for i := len(path) - 1; i >= 0 && !os.IsPathSeparator(path[i]); i-- { |
| 79 | if path[i] == '.' { |
| 80 | ext = path[i:] |
| 81 | } |
| 82 | } |
| 83 | return ext |
| 84 | } |
| 85 | |
| 86 | // load loads the given resource into memory. |
| 87 | func (formats *Formats) load(url string) error { |
no outgoing calls
no test coverage detected