diff options
author | Nick White <git@njw.name> | 2020-02-10 12:10:11 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2020-02-10 12:10:11 +0000 |
commit | add4f53b087613f1cb4178cf9bf94fae96d888a4 (patch) | |
tree | bda673cdf2e313ba8d672dc450468da4aa4245b1 /weather.go | |
parent | d3ce8ad60c147deca4d8d373c477ddb89b4f53a3 (diff) | |
download | weather-add4f53b087613f1cb4178cf9bf94fae96d888a4.tar.bz2 weather-add4f53b087613f1cb4178cf9bf94fae96d888a4.zip |
Make check for description better
Diffstat (limited to 'weather.go')
-rw-r--r-- | weather.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |