Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cleanenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,16 @@ func readStructMetadata(cfgRoot interface{}) ([]structMeta, error) {
separator string
)

// read struct field info
fld := s.Field(idx)

// unwrap struct pointer
if fld.Kind() == reflect.Ptr {
fld = fld.Elem()
}

// process nested structure (except of supported ones)
if fld := s.Field(idx); fld.Kind() == reflect.Struct {
if fld.Kind() == reflect.Struct {
//skip unexported
if !fld.CanInterface() {
continue
Expand Down