MCPcopy Create free account
hub / github.com/micro-editor/micro / MatchFileSignature

Method MatchFileSignature

pkg/highlight/parser.go:180–186  ·  view source on GitHub ↗

MatchFileSignature will check the given line with the stored regex

(line []byte)

Source from the content-addressed store, hash-verified

178
179// MatchFileSignature will check the given line with the stored regex
180func (header *Header) MatchFileSignature(line []byte) bool {
181 if header.SignatureRegex != nil {
182 return header.SignatureRegex.Match(line)
183 }
184
185 return false
186}
187
188func ParseFile(input []byte) (f *File, err error) {
189 // This is just so if we have an error, we can exit cleanly and return the parse error to the user

Callers 1

UpdateRulesMethod · 0.80

Calls 1

MatchMethod · 0.45

Tested by

no test coverage detected