diff options
-rw-r--r-- | weather.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |