Skip to content

Commit

Permalink
BUG/MINOR: version: first match has higher priority
Browse files Browse the repository at this point in the history
  • Loading branch information
prometherion committed Sep 24, 2024
1 parent 21c538d commit 78df2d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions parsers/extra/config-version.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func (p *ConfigVersion) Parse(line string, parts []string, comment string) (stri
if len(data) < 2 {
return "", &errors.ParseError{Parser: "ConfigVersion", Line: line}
}
// version has been already set, first match wins
if p.data != nil {
return "", &errors.ParseError{Parser: "ConfigVersion", Line: line}
}

if version, err := strconv.ParseInt(data[1], 10, 64); err == nil {
p.data = &types.ConfigVersion{
Value: version,
Expand Down

0 comments on commit 78df2d9

Please sign in to comment.