Skip to content

Commit

Permalink
do not reuse path (#316)
Browse files Browse the repository at this point in the history
follow up on #314
  • Loading branch information
ktong authored May 2, 2024
1 parent cf66c74 commit 5859f23
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ func (c *Config) Explain(path string) string {

func (c *Config) explain(explanation *strings.Builder, path string, value any) {
if values, ok := value.(map[string]any); ok {
for k, v := range values {
if path != "" {
path += c.delim()
for key, val := range values {
newPath := path
if newPath != "" {
newPath += c.delim()
}
path += k
c.explain(explanation, path, v)
newPath += key
c.explain(explanation, newPath, val)
}

return
Expand Down

0 comments on commit 5859f23

Please sign in to comment.