diff --git a/main.go b/main.go index df7d1b2..a8ab2fe 100644 --- a/main.go +++ b/main.go @@ -49,7 +49,7 @@ var ( lics []license errFound = errors.New("file found") licre = regexp.MustCompile("([Ll][Ii][Cc][Ee][Nn][Ss][Ee].*)") - pathre = regexp.MustCompile("vendor/(.*/(.*/.*))/|vendor/(.*/.*/)") + pathre = regexp.MustCompile("vendor/(.*/(.*/.*))/") ) func init() { @@ -120,21 +120,11 @@ func walker(path string, info os.FileInfo, err error) error { return err } match := pathre.FindAllStringSubmatch(path, -1) - if len(match) >= 1 { - if len(match[0]) >= 4 { - if match[0][1] == "" { - match[0][1] = match[0][3] - match[0][2] = match[0][3] - } - lics = append(lics, license{ - Path: match[0][2], - URL: match[0][1], - Text: string(text), - }) - } - } else { - return nil - } + lics = append(lics, license{ + Path: match[0][2], + URL: match[0][1], + Text: string(text), + }) return errFound }