-
Notifications
You must be signed in to change notification settings - Fork 1
/
weathercode.go
60 lines (59 loc) · 1.47 KB
/
weathercode.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package openmeteo
func WeatherCodeName(code int) string {
if code == 0 {
return "clear-sky"
} else if code == 1 {
return "mainly-clear"
} else if code == 2 {
return "partly-cloudy"
} else if code == 3 {
return "overcast"
} else if code == 48 {
return "fog"
} else if code == 49 {
return "depositing-rime-fog"
} else if code == 51 {
return "drizzle-light"
} else if code == 53 {
return "drizzle-moderate"
} else if code == 55 {
return "drizzle-dense"
} else if code == 56 {
return "freezing-drizzle-light"
} else if code == 57 {
return "freezing-drizzle-dense"
} else if code == 61 {
return "rain-slight"
} else if code == 63 {
return "rain-moderate"
} else if code == 65 {
return "rain-heavy"
} else if code == 66 {
return "freezing-rain-light"
} else if code == 67 {
return "freezing-rain-heavy"
} else if code == 71 {
return "snow-fall-slight"
} else if code == 73 {
return "snow-fall-moderate"
} else if code == 75 {
return "snow-fall-heavy"
} else if code == 77 {
return "snow-grains"
} else if code == 80 {
return "rain-showers-slight"
} else if code == 81 {
return "rain-showers-moderate"
} else if code == 82 {
return "rain-showers-violent"
} else if code == 85 {
return "snow-showers-slight"
} else if code == 86 {
return "snow-showers-heavy"
} else if code == 95 {
return "thunderstorm-slight-or-moderate"
} else if code == 96 || code == 99 {
return "thunderstorm-slight-and-heavy-hail"
}
return "unknown"
}