1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

Remove app/config/yaml.go as we use viper and mapstructure to parse.

This commit is contained in:
Henrik Hautakoski 2024-02-17 16:43:57 +01:00
parent a0b88d1991
commit 33efb36901

View file

@ -1,26 +0,0 @@
package config
import (
"gopkg.in/yaml.v3"
)
func (ship *ShipConfig) UnmarshalYAML(value *yaml.Node) error {
var err error
if value.Kind == yaml.ScalarNode {
ship.Url = value.Value
} else {
type ShipConfigRaw ShipConfig
raw := ShipConfigRaw(*ship)
if err = value.Decode(&raw); err == nil {
*ship = ShipConfig(raw)
}
}
return err
}
// Read YAML config data
func (cfg *Config) ReadYAML(data []byte) error {
return yaml.Unmarshal(data, cfg)
}