Skip to content

Commit a80754f

Browse files
authored
[chore] Document ToStringMap behavior on values with multiple representations (open-telemetry#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
1 parent 54ae936 commit a80754f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

confmap/confmap.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ func (l *Conf) toStringMapWithExpand() map[string]any {
216216
return m
217217
}
218218

219-
// ToStringMap creates a map[string]any from a Parser.
219+
// ToStringMap creates a map[string]any from a Conf.
220+
// Values with multiple representations
221+
// are normalized with the YAML parsed representation.
222+
//
223+
// For example, for a Conf created from `foo: ${env:FOO}` and `FOO=123`
224+
// ToStringMap will return `map[string]any{"foo": 123}`.
220225
func (l *Conf) ToStringMap() map[string]any {
221226
return sanitize(l.toStringMapWithExpand()).(map[string]any)
222227
}

0 commit comments

Comments
 (0)