ASCII Text Files Starting With Letters "BM" Are Treated As BMP Image Files
AndrewSverdrup opened this issue · comments
Andrew Sverdrup commented
Bug: ASCII Text Files Starting With Letters "BM" Are Treated As BMP Image Files
Example code:
go get github.com/h2non/filetype
package main
import (
"fmt"
"github.com/h2non/filetype"
)
func main() {
file_contents := []byte("BMW")
kind, _ := filetype.Match(file_contents)
fmt.Println(kind)
}
go build -o project *.go
./project
Output:
{{image bmp image/bmp} bmp}