Exemple #1
0
func formatAndSave(spec *parser.Specification) error {
	formatted := FormatSpecification(spec)
	if err := common.SaveFile(spec.FileName, formatted, true); err != nil {
		return err
	}
	return nil
}
Exemple #2
0
func SaveFile(fileName string, content string, backup bool) {
	err := common.SaveFile(fileName, content, backup)
	if err != nil {
		logger.Log.Error("Failed to refactor '%s': %s\n", fileName, err)
	}
}