diff options
author | siddharth <s@ricketyspace.net> | 2022-05-15 22:42:12 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2022-05-15 22:42:12 -0400 |
commit | 331dcaf0139fad478a3451228a2ad215f80876ce (patch) | |
tree | 0bd4174f3f511194fb52aee3a530760d5b1c001b /nws | |
parent | c89871fd1ece24833d5ef01d2fc2b0a3df0837f2 (diff) |
nws: update NWSPointProperties
Add GridX and GridY.
Diffstat (limited to 'nws')
-rw-r--r-- | nws/nws.go | 2 | ||||
-rw-r--r-- | nws/nws_test.go | 6 |
2 files changed, 8 insertions, 0 deletions
@@ -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) |