Skip to content
Snippets Groups Projects
Commit 8ceeefd6 authored by flycash's avatar flycash
Browse files

Fix review

parent 061eb82d
No related branches found
No related tags found
No related merge requests found
......@@ -17,27 +17,11 @@
package config
import (
"github.com/creasty/defaults"
)
// This is the config struct for all metrics implementation
type MetricConfig struct {
Reporters []string `yaml:"reporters" json:"reporters,omitempty"`
}
// parse the config from yml
func (c *MetricConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := defaults.Set(c); err != nil {
return err
}
type plain MetricConfig
if err := unmarshal((*plain)(c)); err != nil {
return err
}
return nil
}
// find the MetricConfig
// if it is nil, create a new one
func GetMetricConfig() *MetricConfig {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment