checks.go 387 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "bytes"
  4. _ "fmt"
  5. "regexp"
  6. )
  7. func checkRegex(diff []byte) {
  8. var re *regexp.Regexp
  9. var found string
  10. lines := bytes.Split(diff, []byte("\n"))
  11. for _, line := range lines {
  12. if len(line) == 0 {
  13. continue
  14. }
  15. for _, v := range regexes {
  16. re = regexp.MustCompile(v)
  17. found = re.FindString(string(line))
  18. if len(found) == 0 {
  19. continue
  20. }
  21. }
  22. }
  23. }