Skip to content

Commit

Permalink
Add comment for check validStruct and encoding.TextUnmarshaler
Browse files Browse the repository at this point in the history
  • Loading branch information
mirecl committed Jul 20, 2023
1 parent f138599 commit a5a43ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cleanenv.go
Expand Up @@ -463,6 +463,8 @@ func parseValue(field reflect.Value, value, sep string, layout *string) error {
valueType := field.Type()

// look for supported struct parser
// parsing of struct must be done before checking the implementation `encoding.TextUnmarshaler`
// standard struct types already have the implementation `encoding.TextUnmarshaler` (for example `time.Time`)
if structParser, found := validStructs[valueType]; found {
return structParser(&field, value, layout)
}
Expand Down

0 comments on commit a5a43ad

Please sign in to comment.