From c89871fd1ece24833d5ef01d2fc2b0a3df0837f2 Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 15 May 2022 22:40:46 -0400 Subject: nws: points -> Points --- nws/nws.go | 4 ++-- nws/nws_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nws/nws.go b/nws/nws.go index 02b4d75..1ae7df5 100644 --- a/nws/nws.go +++ b/nws/nws.go @@ -32,8 +32,8 @@ func (e NWSPointsError) Error() string { return fmt.Sprintf("%d: %s: %s", e.Status, e.Type, e.Detail) } -// NWS API's `/points` endpoint. -func points(lat, lng float32) (*NWSPoints, error) { +// NWS `/points` endpoint. +func Points(lat, lng float32) (*NWSPoints, error) { url := fmt.Sprintf("https://api.weather.gov/points/%.4f,%.4f", lat, lng) resp, err := client.Get(url) if err != nil { diff --git a/nws/nws_test.go b/nws/nws_test.go index 8c52c25..e53788d 100644 --- a/nws/nws_test.go +++ b/nws/nws_test.go @@ -7,7 +7,7 @@ import "testing" func TestPoints(t *testing.T) { // Test valid lat,lng. - np, err := points(41.115, -83.177) + np, err := Points(41.115, -83.177) if err != nil { t.Errorf("points: %v", err) } @@ -19,7 +19,7 @@ func TestPoints(t *testing.T) { } // Test invalid lat,lng - np, err = points(115.0, -83.177) + np, err = Points(115.0, -83.177) if err == nil { t.Errorf("points: %v", np) } -- cgit v1.2.3