(filename string)
| 173 | } |
| 174 | |
| 175 | func DetectByExtension(filename string) string { |
| 176 | ext := strings.ToLower(filepath.Ext(filename)) |
| 177 | return mime.TypeByExtension(ext) |
| 178 | } |
| 179 | |
| 180 | func DetectByContent(data []byte) (string, error) { |
| 181 | mimeType := http.DetectContentType(data) |