File: dns.go

package info (click to toggle)
golang-github-alecthomas-chroma-v2 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 7,980 kB
  • sloc: xml: 33,149; python: 589; javascript: 357; makefile: 36; sh: 36
file content (17 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package lexers

import (
	"regexp"
)

// TODO(moorereason): can this be factored away?
var zoneAnalyserRe = regexp.MustCompile(`(?m)^@\s+IN\s+SOA\s+`)

func init() { // nolint: gochecknoinits
	Get("dns").SetAnalyser(func(text string) float32 {
		if zoneAnalyserRe.FindString(text) != "" {
			return 1.0
		}
		return 0.0
	})
}