diff --git a/collect.go b/collect.go index 1decd48..cbaab5c 100644 --- a/collect.go +++ b/collect.go @@ -25,6 +25,10 @@ func collect(inputPath, outputPath string) *schema.Dependencies { fileStr := rif.readFile() submatches := regex.FindStringSubmatch(fileStr) + if len(submatches) < 1 { + panic(fmt.Errorf("Pattern not found in file\n\n Pattern: %s\n Filename: %s", rif.Pattern, rif.Filename)) + } + currentVersion := submatches[1] if currentVersion == "" {