MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / DeleteColorPattern

Function DeleteColorPattern

internal/colorpatterns/admin.go:39–46  ·  view source on GitHub ↗

DeleteColorPattern removes a named color pattern from memory and persists the file.

(name string)

Source from the content-addressed store, hash-verified

37
38// DeleteColorPattern removes a named color pattern from memory and persists the file.
39func 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
48func saveColorPatternsFile() error {
49 path := configs.GetFilePathsConfig().DataFiles.String() + `/color-patterns.yaml`

Callers 1

apiV1DeleteColorPatternFunction · 0.92

Calls 2

deleteFunction · 0.85
saveColorPatternsFileFunction · 0.85

Tested by

no test coverage detected