Add map[string]T support for config fields #7
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/config#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Config fields of type
map[string]string,map[string]int, etc. are silently ignored during load and write. This is a common config pattern (custom labels, env maps, feature flags).Currently,
tag.goonly inspects struct fields for theconftag. Maps are not handled in:load.goloadFromPath— shadow type builder doesn't handle mapswrite.gobuildMarshalOutput/toMarshalValue— maps go throughv.Interface()but without proper key mappingenv.go— no map supportRequirements
map[string]stringfields should decode from TOML tables, YAML maps, and JSON objectsmap[string]Tfields should be serialized back to the correct formatconf:"name"as the key in the config fileExample
Scope
core/tag.go— shadow type builder needs to handlereflect.Mapcore/load.go—loadFromPath/copyStructFieldsneed map copy supportcore/write.go—toMarshalValue/structToMapneed map handlingVerification