uber-go / config

Configuration for Go applications
https://godoc.org/go.uber.org/config
MIT License
448 stars 41 forks source link

YAML: support non-string scalar keys #105

Closed twilly closed 6 years ago

twilly commented 6 years ago

YAML mappings can be keyed by any kind of node so long as it is unique. That means a mapping key can be an integer, a boolean, or a number of other types besides a string.

Get retrieves a value on a period-separated path and previously interpreted each segment as a string. This change unmarshals each path segment to produce comparable map keys, even if it's a bit strange when "no: car" content produces a value with provider.Get("false").

Resolves #104

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

codecov[bot] commented 6 years ago

Codecov Report

Merging #105 into master will decrease coverage by 0.83%. The diff coverage is 78.94%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #105      +/-   ##
=========================================
- Coverage   93.64%   92.8%   -0.84%     
=========================================
  Files           9       9              
  Lines         409     417       +8     
=========================================
+ Hits          383     387       +4     
- Misses         17      19       +2     
- Partials        9      11       +2
Impacted Files Coverage Δ
internal/merge/merge.go 96.72% <100%> (ø) :arrow_up:
config.go 86.98% <60%> (-2.15%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c37f2f8...8428ca9. Read the comment docs.