Skip to content

Commit

Permalink
do not add the csv header as a broken feature ...
Browse files Browse the repository at this point in the history
  • Loading branch information
istyf committed Feb 21, 2023
1 parent 80ea57c commit 23ab6fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/pkg/application/features/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func NewRegistry(ctx context.Context, input io.Reader) (Registry, error) {

var err error

numErrors := 0
numFeatures := 0

scanner := bufio.NewScanner(input)
Expand Down Expand Up @@ -59,8 +60,12 @@ func NewRegistry(ctx context.Context, input io.Reader) (Registry, error) {
} else if f.Type == presences.FeatureTypeName {
f.Presence = presences.New()
f.handle = f.Presence.Handle
} else if numFeatures > 0 { // allow a failure on the first line
return nil, fmt.Errorf("unable to parse feature config line: \"%s\"", line)
} else {
numErrors++
if numErrors > 1 {
return nil, fmt.Errorf("unable to parse feature config line: \"%s\"", line)
}
continue
}

r.f[tokens[3]] = f
Expand Down

0 comments on commit 23ab6fd

Please sign in to comment.