From f82d4398017b280c2582eac3ef1c380ea90b202c Mon Sep 17 00:00:00 2001 From: Dave Gaeddert Date: Tue, 1 Oct 2019 19:52:01 -0500 Subject: [PATCH] More informative panic on pattern not found --- collect.go | 4 ++++ 1 file changed, 4 insertions(+) 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 == "" {