(remote string)
| 247 | } |
| 248 | |
| 249 | func splitExtension(remote string) (base, exts string) { |
| 250 | base = remote |
| 251 | var ( |
| 252 | first = true |
| 253 | ext = path.Ext(remote) |
| 254 | ) |
| 255 | for ext != "" { |
| 256 | // Look second and subsequent extensions in mime types. |
| 257 | // If they aren't found then don't keep it as an extension. |
| 258 | if !first && mime.TypeByExtension(ext) == "" { |
| 259 | break |
| 260 | } |
| 261 | base = base[:len(base)-len(ext)] |
| 262 | exts = ext + exts |
| 263 | first = false |
| 264 | ext = path.Ext(base) |
| 265 | } |
| 266 | return base, exts |
| 267 | } |
| 268 | |
| 269 | func truncateChars(s string, max int, keepExtension bool) string { |
| 270 | if max <= 0 { |
no outgoing calls
no test coverage detected
searching dependent graphs…