Skip to content

Commit

Permalink
chore: fix redundant if in Load
Browse files Browse the repository at this point in the history
  • Loading branch information
iret-kawashima committed Nov 6, 2023
1 parent 4d56b7d commit f2482c3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mintab.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func WithIgnoreFields(ignoreFields []int) Option {

// Load validates input and converts them to table data.
// Returns error if not struct slice.
func (t *Table) Load(input any) (err error) {
func (t *Table) Load(input any) error {
if _, ok := input.([]interface{}); ok {
return fmt.Errorf("cannot parse input: elements of slice must not be empty interface")
}
Expand All @@ -131,10 +131,7 @@ func (t *Table) Load(input any) (err error) {
}
t.setColorFlags(v)
t.setHeader(e.Type())
if err = t.setData(v); err != nil {
return err
}
return nil
return t.setData(v)
}

// Out outputs the table as a string.
Expand Down

0 comments on commit f2482c3

Please sign in to comment.