models/rule.go
func (r *Rule) Run(content []byte) []RunResult {
	var results []RunResult

	b := bufio.NewScanner(bytes.NewReader(content))

	nLine := 0
	for b.Scan() {
		nLine = nLine + 1
		line := b.Text()

		if r.Match.MatchString(line) {
			unmatch := false
			for _, Unmatch := range r.Unmatch {
				if Unmatch.MatchString(line) {
					unmatch = true
				}
			}

			if !unmatch {
				results = append(results, RunResult{
					Line:  line,
					Nline: nLine,
				})
			}
		}
	}

	return results
}
func (r *Rule) Run(content []byte) []RunResult {
	var results []RunResult

	b := bufio.NewScanner(bytes.NewReader(content))

	nLine := 0
	for b.Scan() {
		nLine = nLine + 1
		line := b.Text()

		if r.Match.MatchString(line) {
			unmatch := false
			for _, Unmatch := range r.Unmatch {
				if Unmatch.MatchString(line) {
					unmatch = true
				}
			}

			if !unmatch {
				results = append(results, RunResult{
					Line:  line,
					Nline: nLine,
				})
			}
		}
	}

	return results
}
// Run executes the rule into a content to find all lines that matches it.