Skip to content

Commit 78df2d9

Browse files
committed
BUG/MINOR: version: first match has higher priority
1 parent 21c538d commit 78df2d9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

parsers/extra/config-version.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ func (p *ConfigVersion) Parse(line string, parts []string, comment string) (stri
5656
if len(data) < 2 {
5757
return "", &errors.ParseError{Parser: "ConfigVersion", Line: line}
5858
}
59+
// version has been already set, first match wins
60+
if p.data != nil {
61+
return "", &errors.ParseError{Parser: "ConfigVersion", Line: line}
62+
}
63+
5964
if version, err := strconv.ParseInt(data[1], 10, 64); err == nil {
6065
p.data = &types.ConfigVersion{
6166
Value: version,

0 commit comments

Comments
 (0)