package main import ( "bufio" "fmt" "log" "os" "strings" "sync" ) func advancedMenu(wg *sync.WaitGroup) { var option string for option != "0" { fmt.Print("\nAdvanced Menu\n-------------\n\n") fmt.Println("1. Change units (Fahrenheit/Celsius)") fmt.Println("2. Enter precise location") fmt.Print("0. Back\n\n") reader := bufio.NewReader(os.Stdin) input, err := reader.ReadString('\n') if err != nil { log.Fatal(err) } option = strings.TrimSuffix(input, "\n") if option == "1" { fmt.Print("\nChanged units...\n\n") } else if option == "2" { fmt.Print("Precise location selected...\n\n") } } wg.Done() }