(mutatorId string)
| 122 | } |
| 123 | |
| 124 | func DeleteMutatorSpec(mutatorId string) error { |
| 125 | spec := GetMutatorSpec(mutatorId) |
| 126 | if spec == nil { |
| 127 | return fmt.Errorf("mutator not found: %s", mutatorId) |
| 128 | } |
| 129 | |
| 130 | basePath := util.FilePath(configs.GetFilePathsConfig().DataFiles.String() + `/mutators/`) |
| 131 | |
| 132 | yamlPath := basePath + spec.Filepath() |
| 133 | if err := os.Remove(yamlPath); err != nil && !os.IsNotExist(err) { |
| 134 | return fmt.Errorf("removing mutator yaml: %w", err) |
| 135 | } |
| 136 | |
| 137 | delete(allMutators, mutatorId) |
| 138 | return nil |
| 139 | } |
no test coverage detected