DeleteColorPattern removes a named color pattern from memory and persists the file.
(name string)
| 37 | |
| 38 | // DeleteColorPattern removes a named color pattern from memory and persists the file. |
| 39 | func DeleteColorPattern(name string) error { |
| 40 | if _, ok := numericPatterns[name]; !ok { |
| 41 | return fmt.Errorf("color pattern %q not found", name) |
| 42 | } |
| 43 | delete(numericPatterns, name) |
| 44 | delete(ShortTagPatterns, name) |
| 45 | return saveColorPatternsFile() |
| 46 | } |
| 47 | |
| 48 | func saveColorPatternsFile() error { |
| 49 | path := configs.GetFilePathsConfig().DataFiles.String() + `/color-patterns.yaml` |
no test coverage detected