Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add method PossibleTypes and fix ms-office matchers' rules#39

Open
DarthPestilane wants to merge 2 commits intoh2non:masterfrom
DarthPestilane:master
Open

add method PossibleTypes and fix ms-office matchers' rules#39
DarthPestilane wants to merge 2 commits intoh2non:masterfrom
DarthPestilane:master

Conversation

@DarthPestilane
Copy link

// 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.

@DarthPestilane
Copy link
Author

Whoops The command "go get -u -v github.com/golang/lint/golint" failed and exited with 2 during .

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.

2 participants