Skip to content

Commit

Permalink
Remove log.Fatal() usage in encoder.go (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
h2570su authored Jan 18, 2024
1 parent 9dff76b commit 4890efc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package schema
import (
"errors"
"fmt"
"log"
"reflect"
"strconv"
)
Expand Down Expand Up @@ -97,7 +96,7 @@ func (e *Encoder) encode(v reflect.Value, dst map[string][]string) error {
if isValidStructPointer(v.Field(i)) && !e.hasCustomEncoder(v.Field(i).Type()) {
err := e.encode(v.Field(i).Elem(), dst)
if err != nil {
log.Fatal(err)
errors[v.Field(i).Elem().Type().String()] = err
}
continue
}
Expand All @@ -118,7 +117,7 @@ func (e *Encoder) encode(v reflect.Value, dst map[string][]string) error {
if v.Field(i).Type().Kind() == reflect.Struct {
err := e.encode(v.Field(i), dst)
if err != nil {
log.Fatal(err)
errors[v.Field(i).Type().String()] = err
}
continue
}
Expand Down

0 comments on commit 4890efc

Please sign in to comment.