tartrazine/internal/code-generator/generator/langinfo.go

23 lines
623 B
Go
Raw Normal View History

package generator
import "sort"
type languageInfo struct {
Type string `yaml:"type,omitempty"`
Aliases []string `yaml:"aliases,omitempty"`
Extensions []string `yaml:"extensions,omitempty,flow"`
Interpreters []string `yaml:"interpreters,omitempty,flow"`
Filenames []string `yaml:"filenames,omitempty,flow"`
2017-07-10 10:50:52 +00:00
MimeType string `yaml:"codemirror_mime_type,omitempty,flow"`
}
func getAlphabeticalOrderedKeys(languages map[string]*languageInfo) []string {
keyList := make([]string, 0)
for lang := range languages {
keyList = append(keyList, lang)
}
sort.Strings(keyList)
return keyList
}