filetype
filetype copied to clipboard
add method `PossibleTypes` and fix ms-office matchers' rules
// PossibleTypes returns the possible mime types of given bytes
func PossibleTypes(b []byte) ([]types.Type, error) {
if len(b) == 0 {
return nil, ErrEmptyBuffer
}
possibleTypes := []types.Type{}
for _, checker := range Matchers {
matchedType := checker(b)
if matchedType != types.Unknown && matchedType.Extension != "" {
possibleTypes = append(possibleTypes, matchedType)
}
}
return possibleTypes, nil
}
and also change the rules of matching Microsoft office documents.
Whoops The command "go get -u -v github.com/golang/lint/golint" failed and exited with 2 during .