WriteConfigFile renders config using the template and writes it to configFilePath.
(configFilePath string, config *Config)
| 57 | |
| 58 | // WriteConfigFile renders config using the template and writes it to configFilePath. |
| 59 | func WriteConfigFile(configFilePath string, config *Config) { |
| 60 | var buffer bytes.Buffer |
| 61 | |
| 62 | if err := configTemplate.Execute(&buffer, config); err != nil { |
| 63 | panic(err) |
| 64 | } |
| 65 | |
| 66 | tmos.MustWriteFile(configFilePath, buffer.Bytes(), 0o644) |
| 67 | } |
| 68 | |
| 69 | // Note: any changes to the comments/variables/mapstructure |
| 70 | // must be reflected in the appropriate struct in config/config.go |
no test coverage detected