package config import ( "fmt" "strings" ) var emojis = map[string]string{ "poop": "💩", "smile": "😀", "ping": "📡", "backup": "💾", "reboot": "🔄", "restart": "🔄", "box": "📦", "ashtonished": "😲", "clock": "🕒", "disk": "💽", "logs": "🔍", "light": "💡", "robot": "🤖", "ssh": "🔐", "theme": "🎨", } func lookupHTMLIcon(keyToLookup string, defaultIcon string) string { if keyToLookup == "" { return defaultIcon } if emoji, found := emojis[keyToLookup]; found { return emoji } keyToLookup = expandShortPathToFullPath(keyToLookup) return keyToLookup } func expandShortPathToFullPath(keyToLookup string) string { if strings.Contains(keyToLookup, "/") && !strings.HasPrefix(keyToLookup, "<") { return fmt.Sprintf("", keyToLookup) } return keyToLookup }