diff --git a/internal/detectors/custom/custom.go b/internal/detectors/custom/custom.go index ced674d7c..4e12f029a 100644 --- a/internal/detectors/custom/custom.go +++ b/internal/detectors/custom/custom.go @@ -387,7 +387,7 @@ func filterCaptures(params []config.Param, captures []parser.Captures) (filtered paramContent := capture[param.BuildFullName()].Content() - if !regex.Match([]byte(paramContent)) { + if !regex.MatchString(paramContent) { shouldIgnore = true break } diff --git a/internal/detectors/sql/util/util.go b/internal/detectors/sql/util/util.go index 0ecae279c..29dc1c3c3 100644 --- a/internal/detectors/sql/util/util.go +++ b/internal/detectors/sql/util/util.go @@ -18,7 +18,7 @@ func ConvertToSimpleType(value string) string { numberMap := []string{"bit", `tinyint(\(\d?\))?`, "smallint", "mediumint", "int", "integer", "bigint", `float(\(\d?,\d?\))`, `double(\(\d?,\d?\))?`, `decimal(\(\d?,\d?\))`, `dec`} for _, typeValue := range numberMap { reg := regexp.MustCompile(typeValue) - if reg.Match([]byte(simplified)) { + if reg.MatchString(simplified) { return schema.SimpleTypeNumber } } @@ -33,7 +33,7 @@ func ConvertToSimpleType(value string) string { stringMap := []string{`char(\(\d?\))?`, `varchar(\(\d?\))?`, `character(\(\d?\))?`, "tinytext", "mediumtext", "longtext"} for _, typeValue := range stringMap { reg := regexp.MustCompile(typeValue) - if reg.Match([]byte(simplified)) { + if reg.MatchString(simplified) { return schema.SimpleTypeString } } diff --git a/internal/git/defunct_cleanup.go b/internal/git/defunct_cleanup.go index 50f3fae08..1d443a2cc 100644 --- a/internal/git/defunct_cleanup.go +++ b/internal/git/defunct_cleanup.go @@ -36,7 +36,7 @@ func cleanupDefunct() { lines := strings.Split(string(stdout), "\n") for _, line := range lines { - if !regexpDefunctProcess.Match([]byte(line)) { + if !regexpDefunctProcess.MatchString(line) { continue } diff --git a/internal/parser/interfaces/paths/paths.go b/internal/parser/interfaces/paths/paths.go index f551cfa86..96f92c273 100644 --- a/internal/parser/interfaces/paths/paths.go +++ b/internal/parser/interfaces/paths/paths.go @@ -41,11 +41,11 @@ func ValueIsRelevant(value *values.Value) bool { return false } - if looksLikeUrl.Match([]byte(text)) { + if looksLikeUrl.MatchString(text) { return false } - if !hasNormalChars.Match([]byte(text)) { + if !hasNormalChars.MatchString(text) { return false } diff --git a/internal/parser/interfaces/urls/urls.go b/internal/parser/interfaces/urls/urls.go index b9755b2ca..65715b1bb 100644 --- a/internal/parser/interfaces/urls/urls.go +++ b/internal/parser/interfaces/urls/urls.go @@ -60,7 +60,7 @@ func textIsRelevant(value *values.Value) bool { return false } - if !hasUsefulInformation.Match([]byte(text)) { + if !hasUsefulInformation.MatchString(text) { return false }