ReadConfigFile unmarshals config from filename. Expands path if needed. If expandEnv is true then environment variables are expanded in the config.
(filename string, expandEnv bool)
| 599 | // ReadConfigFile unmarshals config from filename. Expands path if needed. |
| 600 | // If expandEnv is true then environment variables are expanded in the config. |
| 601 | func ReadConfigFile(filename string, expandEnv bool) (Config, error) { |
| 602 | f, err := OpenConfigFile(filename) |
| 603 | if err != nil { |
| 604 | return DefaultConfig(), err |
| 605 | } |
| 606 | defer f.Close() |
| 607 | |
| 608 | return ParseConfig(f, expandEnv) |
| 609 | } |
| 610 | |
| 611 | // ParseConfig unmarshals config from a reader. |
| 612 | // If expandEnv is true then environment variables are expanded in the config. |
no test coverage detected