Skip to content

Instantly share code, notes, and snippets.

@Aphellirus
Created October 27, 2022 19:05
Show Gist options
  • Save Aphellirus/dfec017e6fd835e3568a11a2d964b6f3 to your computer and use it in GitHub Desktop.
Save Aphellirus/dfec017e6fd835e3568a11a2d964b6f3 to your computer and use it in GitHub Desktop.
How to know the file extension from byte array in golang
//contents []byte
//package filetype
kind, err := filetype.Match(contents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment