diff options
Diffstat (limited to 'rubric_config.go')
-rw-r--r-- | rubric_config.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/rubric_config.go b/rubric_config.go index d533a7b..00cd76c 100644 --- a/rubric_config.go +++ b/rubric_config.go @@ -39,8 +39,9 @@ type InheritableConfig interface { // Program-wide configuration which is recognized // in defaults.toml type Defaults struct { + Description string Points *float32 - Adapter *string + Adapter string /* The TOML library only parses exported fields. @@ -73,18 +74,22 @@ func (child *Defaults) Inherit(p interface{}) { // Inherit properties which haven't been configured if child.Points == nil { - child.Points = parent.Points; + child.Points = parent.Points } - if child.Adapter == nil { - child.Adapter = parent.Adapter; + if child.Adapter == "" { + child.Adapter = parent.Adapter } + if child.Description == "" { + child.Description = parent.Description + } + // Call the inherit method as defined by the adapters // If an adapter is undefined, inherit the parent configuration // // _configs represents all adapters (registered to a runner) - for _, adapter := range *child.configs_ { + for _, adapter := range *parent.configs_ { parent_adapter, parent_exists := parent.adapters_[adapter.Name] child_adapter, child_exists := child.adapters_[adapter.Name] |