h2non / filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature

Home Page:https://pkg.go.dev/github.com/h2non/filetype?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

filetype.IsApplication isn't defined ?

InfoLibre opened this issue · comments

I'm using this code:

if filetype.IsArchive(head) {
  fileType = "archive"
} else if filetype.IsDocument(head) {
  fileType = "document"
} else if filetype.IsFont(head) {
  fileType = "font"
} else if filetype.IsAudio(head) {
  fileType = "audio"
} else if filetype.IsVideo(head) {
  fileType = "video"
} else if filetype.IsImage(head) {
  fileType = "image"
} else if filetype.IsApplication(head) {
  fileType = "application"
} else {
  fileType = "other"
}

Go displays this error:

undefined: filetype.IsApplication

commented

Fixed in v1.1.3