mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-28 19:09:32 -03:00
Squashed 'go-enry/' content from commit 7e3a9a7
git-subtree-dir: go-enry
git-subtree-split: 7e3a9a7241
This commit is contained in:
22
internal/code-generator/assets/vendor.go.tmpl
Normal file
22
internal/code-generator/assets/vendor.go.tmpl
Normal file
@ -0,0 +1,22 @@
|
||||
package data
|
||||
|
||||
import "github.com/go-enry/go-enry/v2/regex"
|
||||
|
||||
{{define "mustCompile" -}}
|
||||
{{ if isRE2 . -}}
|
||||
regex.MustCompile({{ . | stringVal }})
|
||||
{{- else -}}
|
||||
regex.MustCompileRuby({{ . | stringVal }})
|
||||
{{- end -}}
|
||||
{{end}}
|
||||
|
||||
var VendorMatchers = []regex.EnryRegexp{
|
||||
{{range $re := . -}}
|
||||
{{ template "mustCompile" $re }},
|
||||
{{end -}}
|
||||
}
|
||||
|
||||
// FastVendorMatcher is equivalent to matching any of the VendorMatchers.
|
||||
{{with $singleRE := collateAllRegexps . -}}
|
||||
var FastVendorMatcher = {{template "mustCompile" $singleRE}}
|
||||
{{end}}
|
Reference in New Issue
Block a user