Created
December 29, 2021 17:21
-
-
Save nwillc/89ad39d002e669b9a12838cc33668d7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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