filetype icon indicating copy to clipboard operation
filetype copied to clipboard

add method `PossibleTypes` and fix ms-office matchers' rules

Open DarthPestilane opened this issue 7 years ago • 1 comments

// 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 avatar May 16 '18 08:05 DarthPestilane

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

DarthPestilane avatar May 16 '18 08:05 DarthPestilane