From 65905fda08082df9d4cca0be28f7ae9c1672eaf5 Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Sat, 18 Jun 2022 05:42:50 -0400 Subject: weather: update `Alert` Change type of `Description` and `Instruction` to `[]string`. --- weather/weather.go | 9 ++++----- 1 file 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 } -- cgit v1.2.3