summaryrefslogtreecommitdiff
path: root/weather.go
diff options
context:
space:
mode:
Diffstat (limited to 'weather.go')
-rw-r--r--weather.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weather.go b/weather.go
index c421f68..65862f3 100644
--- a/weather.go
+++ b/weather.go
@@ -237,8 +237,8 @@ func main() {
for _, w := range weather {
fmt.Printf("%s %s ", w.date, w.time)
- desc := TypeDescription[w.weathertype]
- if desc == "" {
+ desc, ok := TypeDescription[w.weathertype]
+ if !ok {
desc = fmt.Sprintf("%d", w.weathertype)
}
fmt.Printf("%18s, Temp: %4.1f°C, ", desc, w.temperature)