1
0
mirror of https://github.com/rancher/os.git synced 2025-09-02 23:34:57 +00:00
Files
os/config/default.go

19 lines
345 B
Go
Raw Normal View History

2015-02-16 22:08:48 -07:00
package config
func NewConfig() *CloudConfig {
2015-08-20 19:20:51 +05:00
return ReadConfig(nil, OsConfigFile)
}
2015-08-20 19:20:51 +05:00
func ReadConfig(bytes []byte, files ...string) *CloudConfig {
if data, err := readConfig(bytes, files...); err == nil {
c := &CloudConfig{}
2015-08-20 19:20:51 +05:00
if err := c.merge(data); err != nil {
return nil
}
c.amendNils()
return c
} else {
return nil
2015-02-16 22:08:48 -07:00
}
}