default.go 243 B

12345678910111213141516
  1. package config
  2. func NewConfig() *Config {
  3. return ReadConfig(OsConfigFile)
  4. }
  5. func ReadConfig(file string) *Config {
  6. if data, err := readConfig(nil, file); err == nil {
  7. c := &Config{}
  8. c.merge(data)
  9. return c
  10. } else {
  11. return nil
  12. }
  13. }