mirror of
https://github.com/cheat/cheat.git
synced 2024-11-17 17:35:21 +01:00
1790aec85d
Bump `alecthomas/chroma` to `v2`: https://github.com/cheat/cheat/issues/735
17 lines
326 B
Go
17 lines
326 B
Go
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
|
|
})
|
|
}
|