diff options
| author | siddharth ravikumar <s@ricketyspace.net> | 2026-01-19 14:16:29 -0500 |
|---|---|---|
| committer | siddharth ravikumar <s@ricketyspace.net> | 2026-01-19 14:17:22 -0500 |
| commit | 546863e8a821648c3614ee6859891512805965ef (patch) | |
| tree | 555a2f1de676b41b82a5bf7f4811f23da07021c5 /weather | |
| parent | 1a14419e39055c0e87c651339b7276938d68de98 (diff) | |
weather: update NewWeather
Add AreadDesc and Headline to Alert.
Diffstat (limited to 'weather')
| -rw-r--r-- | weather/weather.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weather/weather.go b/weather/weather.go index 0e981a1..456ff46 100644 --- a/weather/weather.go +++ b/weather/weather.go @@ -47,8 +47,10 @@ type WeatherTimeline struct { } type Alert struct { + AreaDesc string Event string Severity string + Headline string Description []string Instruction []string } @@ -132,8 +134,10 @@ func NewWeather(lat, lng float32) (*Weather, error, int) { continue // Duplicate; skip. } a := Alert{ + AreaDesc: strings.ReplaceAll(f.Properties.AreaDesc, ";", ","), Event: f.Properties.Event, Severity: f.Properties.Severity, + Headline: f.Properties.Headline, Description: strings.Split(f.Properties.Description, "\n\n"), Instruction: strings.Split(f.Properties.Instruction, "\n\n"), } |
