summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-06-18 05:42:50 -0400
committersiddharth ravikumar <s@ricketyspace.net>2022-06-18 05:42:50 -0400
commit65905fda08082df9d4cca0be28f7ae9c1672eaf5 (patch)
treea9dcc383e0ff23fdbaec79153ba06c6f906d6846
parente605d52c2288b53cd78c7db7d290c386161bbf17 (diff)
weather: update `Alert`
Change type of `Description` and `Instruction` to `[]string`.
-rw-r--r--weather/weather.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/weather/weather.go b/weather/weather.go
index c3f48a3..e001255 100644
--- a/weather/weather.go
+++ b/weather/weather.go
@@ -47,8 +47,8 @@ type WeatherTimeline struct {
type Alert struct {
Event string
Severity string
- Description string
- Instruction string
+ Description []string
+ Instruction []string
}
func NewWeather(lat, lng float32) (*Weather, error, int) {
@@ -125,12 +125,11 @@ func NewWeather(lat, lng float32) (*Weather, error, int) {
a := Alert{
Event: f.Properties.Event,
Severity: f.Properties.Severity,
- Description: f.Properties.Description,
- Instruction: f.Properties.Instruction,
+ Description: strings.Split(f.Properties.Description, "\n\n"),
+ Instruction: strings.Split(f.Properties.Instruction, "\n\n"),
}
w.Alerts = append(w.Alerts, a)
}
}
-
return w, nil, 200
}