From 331dcaf0139fad478a3451228a2ad215f80876ce Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 15 May 2022 22:42:12 -0400 Subject: nws: update NWSPointProperties Add GridX and GridY. --- nws/nws.go | 2 ++ nws/nws_test.go | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'nws') diff --git a/nws/nws.go b/nws/nws.go index 1ae7df5..243506b 100644 --- a/nws/nws.go +++ b/nws/nws.go @@ -13,6 +13,8 @@ import ( ) type NWSPointProperties struct { + GridX int + GridY int ForecastLink string `json:"forecast"` ForecastHourlyLink string `json:"forecastHourly"` } diff --git a/nws/nws_test.go b/nws/nws_test.go index e53788d..db288d2 100644 --- a/nws/nws_test.go +++ b/nws/nws_test.go @@ -17,6 +17,12 @@ func TestPoints(t *testing.T) { if np.Properties.ForecastHourlyLink != "https://api.weather.gov/gridpoints/CLE/33,42/forecast/hourly" { t.Errorf("points: forcecast link: '%v'", np.Properties.ForecastHourlyLink) } + if np.Properties.GridX != 33 { + t.Errorf("points: gridx: %v", np.Properties.GridX) + } + if np.Properties.GridY != 42 { + t.Errorf("points: gridy: %v", np.Properties.GridY) + } // Test invalid lat,lng np, err = Points(115.0, -83.177) -- cgit v1.2.3