Skip to content

Commit

Permalink
Merge pull request #21 from wrfly/shaun/fix/ignore-unexported-fields
Browse files Browse the repository at this point in the history
fix: ignore unexported fields
  • Loading branch information
wrfly authored Nov 16, 2023
2 parents 40f2106 + 78b91ad commit 0a39d47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ecp.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func (e *ecp) List(config interface{}, prefix ...string) []string {
configValue := toValue(config)
configType := configValue.Type()
for index := 0; index < configValue.NumField(); index++ {
if !configType.Field(index).IsExported() {
continue
}
all := e.getAll(getAllOpt{configType, configValue, index, parentName})
if all.parent == "-" || all.key == "" {
continue
Expand Down

0 comments on commit 0a39d47

Please sign in to comment.