Initial commit (code only without large binaries)
This commit is contained in:
14
EdgeCommon/pkg/configutils/yaml.go
Normal file
14
EdgeCommon/pkg/configutils/yaml.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package configutils
|
||||
|
||||
import (
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
)
|
||||
|
||||
func UnmarshalYamlFile(file string, ptr interface{}) error {
|
||||
data, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return yaml.Unmarshal(data, ptr)
|
||||
}
|
||||
Reference in New Issue
Block a user