diff options
author | siddharth ravikumar <s@ricketyspace.net> | 2022-06-12 19:41:06 -0400 |
---|---|---|
committer | siddharth ravikumar <s@ricketyspace.net> | 2022-06-12 19:41:06 -0400 |
commit | 16a8651571e7e489e1d22c5546db0153608bb48a (patch) | |
tree | 8acbedb849d021e000db4109182cd2c1d948237a /main.go | |
parent | 7abdb69a69c793a153275e8645253a6ba5f05721 (diff) |
weather: update NewWeather
Change arguments to just `lat`, `lng`. Make this function call NWS
directly.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -14,7 +14,6 @@ import ( "strconv" "strings" - "ricketyspace.net/peach/nws" "ricketyspace.net/peach/photon" "ricketyspace.net/peach/version" "ricketyspace.net/peach/weather" @@ -93,17 +92,10 @@ func main() { } func showWeather(w http.ResponseWriter, lat, lng float32) { - forecastBundle, nwsErr := nws.GetForecastBundle(lat, lng) - if nwsErr != nil { - http.Error(w, nwsErr.Error(), nwsErr.Status) - } - // Make weather - weather, err := weather.NewWeather(forecastBundle.Point, - forecastBundle.Forecast, - forecastBundle.ForecastHourly) + weather, err, status := weather.NewWeather(lat, lng) if err != nil { - http.Error(w, err.Error(), 500) + http.Error(w, err.Error(), status) return } |