Files
EdgeCommon/pkg/configutils/yaml.go

15 lines
239 B
Go
Raw Normal View History

2020-09-13 19:27:47 +08:00
package configutils
import (
"github.com/go-yaml/yaml"
"io/ioutil"
)
func UnmarshalYamlFile(file string, ptr interface{}) error {
data, err := ioutil.ReadFile(file)
if err != nil {
return err
}
return yaml.Unmarshal(data, ptr)
}