// WriteConfig saves the configurations to a file
// in the specified output format
WriteConfig saves the configurations to a file
in the specified output format
// WriteConfig saves the configurations to a file // in the specified output format
func WriteConfig(configType string, filePath string, config *configValues) error {
	var fileBody bytes.Buffer
	fileTemplate := getFileFormat(configType)
	err := fileTemplate.Execute(&fileBody, config)
	if err != nil {
		return err
	}
	fileData := []byte(fileBody.String())
	if filePath == "" {
		filePath = getDefaultPath(configType)
	}
	return ioutil.WriteFile(filePath, fileData, 0o600)
}
func WriteConfig ( configType string , filePath string , config * configValues ) error { var fileBody bytes . Buffer fileTemplate := getFileFormat ( configType ) err := fileTemplate . Execute ( & fileBody , config ) if err != nil { return err } fileData := [ ] byte ( fileBody . String ( ) ) if filePath == " " { filePath = getDefaultPath ( configType ) } return ioutil . WriteFile ( filePath , fileData , 0o600 ) }
WriteConfig saves the configurations to a file
in the specified output format
WriteConfig saves the configurations to a file in the specified output format