Skip to content

Conversation

sergolius
Copy link

No description provided.

@henvic
Copy link

henvic commented Sep 27, 2019

While deterministic is better than undeterministic, shouldn't it try to match to the "most specialized" first? Like, probably change the mimetypes map to a slice of mimetypes and try to sort it manually in the best possible order.

@slockij
Copy link

slockij commented Sep 27, 2019

another suggestion - it could also return multiple values (so all matching):
`filetype.MatchMulti([]byte) ([]filetype.Type, error)

@h2non
Copy link
Owner

h2non commented Mar 5, 2020

This is a good initial approach, but not enough. We need to explicitly order matchers based on the most specific first. I guess it's better to define an array that respects order on each matchers category file.

A PR is very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants