Пример #1
0
func (s *Search) FindRegex(f *file.File, line string) {
	words := s.Regex.FindAllString(line, -1)
	if len(words) > 0 {
		for _, v := range words {
			f.WriteComment(s.Range(line, v))
		}
	}
}
Пример #2
0
func (s *Search) FindText(f *file.File, line string) {
	if strings.Contains(line, s.Text) {
		f.WriteComment(s.Range(line, s.Text))
	}
}