diff --git a/modules/collect.go b/modules/collect.go index 4eb12a1a6a8..7034a6b161f 100644 --- a/modules/collect.go +++ b/modules/collect.go @@ -556,6 +556,9 @@ func (c *collector) collectModulesTXT(owner Module) error { line := scanner.Text() line = strings.Trim(line, "# ") line = strings.TrimSpace(line) + if line == "" { + continue + } parts := strings.Fields(line) if len(parts) != 2 { return fmt.Errorf("invalid modules list: %q", filename)