summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2022-05-15 22:42:12 -0400
committersiddharth <s@ricketyspace.net>2022-05-15 22:42:12 -0400
commit331dcaf0139fad478a3451228a2ad215f80876ce (patch)
tree0bd4174f3f511194fb52aee3a530760d5b1c001b
parentc89871fd1ece24833d5ef01d2fc2b0a3df0837f2 (diff)
nws: update NWSPointProperties
Add GridX and GridY.
-rw-r--r--nws/nws.go2
-rw-r--r--nws/nws_test.go6
2 files changed, 8 insertions, 0 deletions
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)