Skip to content

Commit

Permalink
modules: Skip empty lines in modules.txt
Browse files Browse the repository at this point in the history
Closes #13084
  • Loading branch information
bep committed Nov 23, 2024
1 parent e00fdae commit 0ab8189
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ab8189

Please sign in to comment.