Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Removed fmt.Errorf in csv for errors that did not require formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Corbin Phelps <[email protected]>
  • Loading branch information
Corbin Phelps committed Dec 2, 2021
1 parent 274546b commit 560c9fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions operator/builtin/parser/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package csv
import (
"context"
csvparser "encoding/csv"
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -51,7 +52,7 @@ func (c CSVParserConfig) Build(context operator.BuildContext) ([]operator.Operat
}

if c.Header == "" {
return nil, fmt.Errorf("missing required field 'header'")
return nil, errors.New("missing required field 'header'")
}

if c.FieldDelimiter == "" {
Expand All @@ -65,7 +66,7 @@ func (c CSVParserConfig) Build(context operator.BuildContext) ([]operator.Operat
fieldDelimiter := []rune(c.FieldDelimiter)[0]

if !strings.Contains(c.Header, c.FieldDelimiter) {
return nil, fmt.Errorf("missing field delimiter in header")
return nil, errors.New("missing field delimiter in header")
}

numFields := len(strings.Split(c.Header, c.FieldDelimiter))
Expand Down

0 comments on commit 560c9fc

Please sign in to comment.