1
0
mirror of https://github.com/rancher/os.git synced 2025-06-24 05:57:03 +00:00
os/config/default.go
2015-08-20 19:20:51 +05:00

19 lines
345 B
Go

package config
func NewConfig() *CloudConfig {
return ReadConfig(nil, OsConfigFile)
}
func ReadConfig(bytes []byte, files ...string) *CloudConfig {
if data, err := readConfig(bytes, files...); err == nil {
c := &CloudConfig{}
if err := c.merge(data); err != nil {
return nil
}
c.amendNils()
return c
} else {
return nil
}
}