Browse Source

fix(discovery): adjust how type is retrieved in Configs' MarshalYAML/UnmarshalYAML

Signed-off-by: machine424 <ayoubmrini424@gmail.com>
pull/14752/merge
machine424 2 months ago committed by Ayoub Mrini
parent
commit
b5569c4070
  1. 4
      discovery/discovery.go

4
discovery/discovery.go

@ -109,7 +109,7 @@ func (c *Configs) SetDirectory(dir string) {
// UnmarshalYAML implements yaml.Unmarshaler.
func (c *Configs) UnmarshalYAML(unmarshal func(interface{}) error) error {
cfgTyp := getConfigType(configsType)
cfgTyp := reflect.StructOf(configFields)
cfgPtr := reflect.New(cfgTyp)
cfgVal := cfgPtr.Elem()
@ -124,7 +124,7 @@ func (c *Configs) UnmarshalYAML(unmarshal func(interface{}) error) error {
// MarshalYAML implements yaml.Marshaler.
func (c Configs) MarshalYAML() (interface{}, error) {
cfgTyp := getConfigType(configsType)
cfgTyp := reflect.StructOf(configFields)
cfgPtr := reflect.New(cfgTyp)
cfgVal := cfgPtr.Elem()

Loading…
Cancel
Save