Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created December 29, 2021 17:21
Show Gist options
  • Save nwillc/89ad39d002e669b9a12838cc33668d7d to your computer and use it in GitHub Desktop.
Save nwillc/89ad39d002e669b9a12838cc33668d7d to your computer and use it in GitHub Desktop.
func colors(colorNames map[string]tcell.Color) string {
var names []string
for name := range colorNames {
names = append(names, name)
}
sort.Strings(names)
return strings.Join(names, ", ")
}
func fonts(names []string) string {
sort.Slice(names, func(i, j int) bool {
ii, _ := strconv.Atoi(names[i])
jj, _ := strconv.Atoi(names[j])
return ii < jj
})
return strings.Join(names, ", ")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment