Skip to content

Commit

Permalink
refactor: remove unneccessary line (#212)
Browse files Browse the repository at this point in the history
* `nil` check line removed from the `newParserError`function. Because it
is called from other functions after checking the `err` whether its value
is `nil`. That's why no need to check it again inside the function.

* This change will also increase the code coverage from 98.2% to 98.7%
with Go's code coverage metrics.

Signed-off-by: Gökhan Özeloğlu <[email protected]>
  • Loading branch information
gozeloglu authored Jan 13, 2022
1 parent 92ee88e commit 8eb2e72
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,6 @@ func parseTextUnmarshalers(field reflect.Value, data []string, sf reflect.Struct
}

func newParseError(sf reflect.StructField, err error) error {
if err == nil {
return nil
}
return parseError{
sf: sf,
err: err,
Expand Down

0 comments on commit 8eb2e72

Please sign in to comment.