From 35748b22331e2dd99f73073836f4f8e9193b0fcf Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Tue, 26 Jul 2022 22:22:05 -0400 Subject: [PATCH] Added comments --- cmd/client/location.go | 2 ++ cmd/client/weather.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cmd/client/location.go b/cmd/client/location.go index c1c670b..bee23a0 100644 --- a/cmd/client/location.go +++ b/cmd/client/location.go @@ -11,6 +11,7 @@ import ( "strings" ) +// Use WAN address to obtain location data func getLocation(app *application) { res, err := http.Get("https://ipinfo.io/json") @@ -35,6 +36,7 @@ func getLocation(app *application) { app.Config.Latitude, app.Config.Longitude = loc[0], loc[1] } +// Prompt user for location func getPreciseLocation(app *application) { fmt.Print("\nEnter latitude: ") diff --git a/cmd/client/weather.go b/cmd/client/weather.go index fdba3a1..8e9dab4 100644 --- a/cmd/client/weather.go +++ b/cmd/client/weather.go @@ -7,6 +7,7 @@ import ( "net/http" ) +// Get and store the current forecast func getCurrent(app *application) { lat := "lat=" + app.Config.Latitude