2017-06-08 10:28:36 +00:00
|
|
|
package data
|
2017-04-07 07:25:49 +00:00
|
|
|
|
2020-04-15 15:27:48 +00:00
|
|
|
import "github.com/go-enry/go-enry/v2/regex"
|
2017-04-07 07:25:49 +00:00
|
|
|
|
2023-02-16 16:55:57 +00:00
|
|
|
{{define "mustCompile" -}}
|
|
|
|
{{ if isRE2 . -}}
|
|
|
|
regex.MustCompile({{ . | stringVal }})
|
|
|
|
{{- else -}}
|
|
|
|
regex.MustCompileRuby({{ . | stringVal }})
|
|
|
|
{{- end -}}
|
|
|
|
{{end}}
|
|
|
|
|
2020-04-15 15:27:48 +00:00
|
|
|
var VendorMatchers = []regex.EnryRegexp{
|
2022-12-25 10:58:23 +00:00
|
|
|
{{range $re := . -}}
|
2023-02-16 16:55:57 +00:00
|
|
|
{{ template "mustCompile" $re }},
|
2017-04-07 07:25:49 +00:00
|
|
|
{{end -}}
|
2020-04-15 15:27:48 +00:00
|
|
|
}
|
2022-11-21 11:52:56 +00:00
|
|
|
|
|
|
|
// FastVendorMatcher is equivalent to matching any of the VendorMatchers.
|
2023-02-16 16:55:57 +00:00
|
|
|
{{with $singleRE := collateAllRegexps . -}}
|
|
|
|
var FastVendorMatcher = {{template "mustCompile" $singleRE}}
|
|
|
|
{{end}}
|