Minor changes to user prompts

This commit is contained in:
Andrew Scott 2022-07-11 19:07:24 -04:00
parent e68ede2c98
commit 9296d7a629
Signed by: a
GPG key ID: 3EB62D0BBB8DB381
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@ func advancedMenu(app *application) {
fmt.Print("\nAdvanced Menu\n-------------\n\n")
fmt.Println("1. Change units (Default: Imperial)")
fmt.Printf("1. Change units (Default: imperial; Current: %s)\n", app.Config.Units)
fmt.Println("2. Enter precise location")
fmt.Print("0. Back\n\n")

View file

@ -37,20 +37,20 @@ func getLocation(app *application) {
func getPreciseLocation(app *application) {
fmt.Print("\nEnter longitude: ")
fmt.Print("\nEnter latitude: ")
reader := bufio.NewReader(os.Stdin)
input, err := reader.ReadString('\n')
if err != nil {
log.Println(err)
}
app.Config.Longitude = strings.TrimSuffix(input, "\n")
app.Config.Latitude = strings.TrimSuffix(input, "\n")
fmt.Print("\nEnter latitude: ")
fmt.Print("\nEnter longitude: ")
input, err = reader.ReadString('\n')
if err != nil {
log.Println(err)
}
app.Config.Latitude = strings.TrimSuffix(input, "\n")
app.Config.Longitude = strings.TrimSuffix(input, "\n")
}