package modulecatalog import "strings" const ( KeyGlossary = "glossary" KeyHomophones = "homophones" KeySpokenWord = "spoken_word" KeyGrammar = "grammar" ) var supportedKeys = []string{ KeyGlossary, KeyHomophones, KeySpokenWord, KeyGrammar, } var supportedKeySet = map[string]struct{}{ KeyGlossary: {}, KeyHomophones: {}, KeySpokenWord: {}, KeyGrammar: {}, } func SupportedKeys() []string { out := make([]string, len(supportedKeys)) copy(out, supportedKeys) return out } func IsSupported(key string) bool { _, ok := supportedKeySet[strings.TrimSpace(key)] return ok }