mirror of
https://codeberg.org/andyscott/weather-cli.git
synced 2024-12-21 12:43:09 -05:00
Added comments
This commit is contained in:
parent
91eb2a5aa1
commit
35748b2233
2 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Use WAN address to obtain location data
|
||||||
func getLocation(app *application) {
|
func getLocation(app *application) {
|
||||||
|
|
||||||
res, err := http.Get("https://ipinfo.io/json")
|
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]
|
app.Config.Latitude, app.Config.Longitude = loc[0], loc[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prompt user for location
|
||||||
func getPreciseLocation(app *application) {
|
func getPreciseLocation(app *application) {
|
||||||
|
|
||||||
fmt.Print("\nEnter latitude: ")
|
fmt.Print("\nEnter latitude: ")
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Get and store the current forecast
|
||||||
func getCurrent(app *application) {
|
func getCurrent(app *application) {
|
||||||
|
|
||||||
lat := "lat=" + app.Config.Latitude
|
lat := "lat=" + app.Config.Latitude
|
||||||
|
|
Loading…
Reference in a new issue