summaryrefslogtreecommitdiff
path: root/weather.go
diff options
context:
space:
mode:
Diffstat (limited to 'weather.go')
-rw-r--r--weather.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weather.go b/weather.go
index cb6128d..237b707 100644
--- a/weather.go
+++ b/weather.go
@@ -236,7 +236,11 @@ func main() {
for _, w := range weather {
fmt.Printf("%s %s ", w.date, w.time)
- fmt.Printf("%18s, Temp: %4.1f°C, ", TypeDescription[w.weathertype], w.temperature)
+ desc := TypeDescription[w.weathertype]
+ if desc == "" {
+ desc = fmt.Sprintf("%d", w.weathertype)
+ }
+ fmt.Printf("%18s, Temp: %4.1f°C, ", desc, w.temperature)
fmt.Printf("Rain: %2d%%, Wind: %4.1fmph\n", w.precipitation, w.windspeed)
if *verbose {
fmt.Printf(" %+v\n", w)