Skip to content

Commit

Permalink
document behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
lovromazgon committed Apr 15, 2024
1 parent e564966 commit 3d53547
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,14 @@ func (c Config) getKeysForParameter(key string) []string {
break
}

// Between tokens there is a wildcard, we need to strip the key until
// the next ".".
_, k, ok = strings.Cut(k, ".")
if ok {
k = "." + k // Add the "." back to the key.
// Between tokens there is a wildcard, we need to consume the key
// until the next ".". If there is no next ".", the whole key is
// consumed.
// e.g. "foo.format" -> ".format" or "foo" -> ""
if index := strings.IndexRune(k, '.'); index != -1 {
k = k[index:]
} else {
k = ""
}
}
}
Expand Down

0 comments on commit 3d53547

Please sign in to comment.