From 1b0212d9ea200975c6993d985de98b6fcbdf2774 Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Sat, 4 Mar 2017 21:11:55 +0100 Subject: [PATCH] simplify emoji frontend --- frontends/emoji.go | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/frontends/emoji.go b/frontends/emoji.go index e5910cd..7c166e5 100644 --- a/frontends/emoji.go +++ b/frontends/emoji.go @@ -57,26 +57,26 @@ func (c *emojiConfig) formatTemp(cond iface.Cond) string { } func (c *emojiConfig) formatCond(cur []string, cond iface.Cond, current bool) (ret []string) { - codes := map[iface.WeatherCode][]string{ - iface.CodeUnknown: {"✨"}, - iface.CodeCloudy: {"☁️"}, - iface.CodeFog: {"🌫"}, - iface.CodeHeavyRain: {"🌧"}, - iface.CodeHeavyShowers: {"🌧"}, - iface.CodeHeavySnow: {"❄️"}, - iface.CodeHeavySnowShowers: {"❄️"}, - iface.CodeLightRain: {"🌦"}, - iface.CodeLightShowers: {"🌦"}, - iface.CodeLightSleet: {"🌧"}, - iface.CodeLightSleetShowers: {"🌧"}, - iface.CodeLightSnow: {"🌨"}, - iface.CodeLightSnowShowers: {"🌨"}, - iface.CodePartlyCloudy: {"⛅️"}, - iface.CodeSunny: {"☀️"}, - iface.CodeThunderyHeavyRain: {"🌩"}, - iface.CodeThunderyShowers: {"⛈"}, - iface.CodeThunderySnowShowers: {"⛈"}, - iface.CodeVeryCloudy: {"☁️"}, + codes := map[iface.WeatherCode]string{ + iface.CodeUnknown: "✨", + iface.CodeCloudy: "☁️", + iface.CodeFog: "🌫", + iface.CodeHeavyRain: "🌧", + iface.CodeHeavyShowers: "🌧", + iface.CodeHeavySnow: "❄️", + iface.CodeHeavySnowShowers: "❄️", + iface.CodeLightRain: "🌦", + iface.CodeLightShowers: "🌦", + iface.CodeLightSleet: "🌧", + iface.CodeLightSleetShowers: "🌧", + iface.CodeLightSnow: "🌨", + iface.CodeLightSnowShowers: "🌨", + iface.CodePartlyCloudy: "⛅️", + iface.CodeSunny: "☀️", + iface.CodeThunderyHeavyRain: "🌩", + iface.CodeThunderyShowers: "⛈", + iface.CodeThunderySnowShowers: "⛈", + iface.CodeVeryCloudy: "☁️", } icon, ok := codes[cond.Code] @@ -90,7 +90,7 @@ func (c *emojiConfig) formatCond(cur []string, cond iface.Cond, current bool) (r } ret = append(ret, fmt.Sprintf("%v %v %v", cur[0], "", desc)) - ret = append(ret, fmt.Sprintf("%v %v %v", cur[1], icon[0], c.formatTemp(cond))) + ret = append(ret, fmt.Sprintf("%v %v %v", cur[1], icon, c.formatTemp(cond))) return }