Document and benchmark sibling inheritance
This commit is contained in:
@@ -52,6 +52,22 @@ func Example_seriatim() {
|
||||
// Output: visitor true the event occurred <nil> <nil>
|
||||
}
|
||||
|
||||
func Example_inheritedPresets() {
|
||||
result, err := consumers.LoadPresets(configkit.File(fixture("inheritance", "presets.yml")))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
path := configkit.Keys("presets", "custom", "enabled")
|
||||
info, _ := result.Metadata().Lookup(path)
|
||||
custom := result.Config.Presets["custom"]
|
||||
fmt.Println(custom.Enabled, result.Metadata().IsExplicit(path), custom.Settings["secondary"]["width"])
|
||||
fmt.Println(info.Origin.Locations[0].SourceID, info.Origin.Inheritance[0].From)
|
||||
// Output:
|
||||
// false true 20
|
||||
// source-1 /presets/base/enabled
|
||||
}
|
||||
|
||||
func Example_weatherStartup() {
|
||||
const blockedName = "CONFIGKIT_WEATHER_EXAMPLE_BLOCKED"
|
||||
const tokenName = "CONFIGKIT_WEATHER_EXAMPLE_TOKEN"
|
||||
|
||||
Reference in New Issue
Block a user