3 func DetectFiletype(defs []*Def, filename string, firstLine []byte) *Def {
4 for _, d := range defs {
5 if d.ftdetect[0].Match([]byte(filename)) {
8 if len(d.ftdetect) > 1 {
9 if d.ftdetect[1].Match(firstLine) {
16 emptyDef.FileType = "Unknown"
17 emptyDef.rules = new(Rules)