func formatAndSave(spec *parser.Specification) error { formatted := FormatSpecification(spec) if err := common.SaveFile(spec.FileName, formatted, true); err != nil { return err } return nil }
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) } }