[chore] Document ToStringMap behavior on values with multiple representations (#13061)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Documents the behavior of `ToStringMap` when there are multiple
representations available
This commit is contained in:
Pablo Baeyens 2025-05-21 18:52:36 +02:00 committed by GitHub
parent 54ae936973
commit a80754f55f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -216,7 +216,12 @@ func (l *Conf) toStringMapWithExpand() map[string]any {
return m
}
// ToStringMap creates a map[string]any from a Parser.
// ToStringMap creates a map[string]any from a Conf.
// Values with multiple representations
// are normalized with the YAML parsed representation.
//
// For example, for a Conf created from `foo: ${env:FOO}` and `FOO=123`
// ToStringMap will return `map[string]any{"foo": 123}`.
func (l *Conf) ToStringMap() map[string]any {
return sanitize(l.toStringMapWithExpand()).(map[string]any)
}