filetype
Fast, dependency-free Go package to infer binary file types
...It examines file headers rather than relying on filename extensions, making detection useful for uploads and untrusted input. The API can match raw byte buffers and return a detected extension and MIME type. Developers can also check whether data belongs to supported categories such as images, audio, video, archives, or documents. Custom file-type matchers can be registered when an application needs formats outside the built-in set. The package is intentionally small and avoids external runtime dependencies. It is useful for validation, content routing, upload inspection, and lightweight file discovery in Go applications.