Question: How do I add a prompt to the beginning of a Scan statement in GoLang?
Current Output:
Enter Phrase:
Hello World!
You typed: Hello world!
Desired Output:
Enter Phrase: Hello world!
You typed: Hello world!
My Code:
package main
import(
"fmt"
)
func main() {
var phrase string
fmt.Println("Enter Phrase: ")
fmt.Scan(&phrase)
fmt.Println("You typed: ", phrase)
}
P.S. I'm sorry for posting such an elementary question. I have spent several hours researching, and I genuinely cannot find the answer.