23 lines
461 B
Go
23 lines
461 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
firstName := getUserData("Please enter your first name: ")
|
|
lastName := getUserData("Please enter your last name: ")
|
|
birthdate := getUserData("Please enter your birthdate (MM/DD/YYYY): ")
|
|
|
|
// ... do something awesome with that gathered data!
|
|
|
|
fmt.Println(firstName, lastName, birthdate)
|
|
}
|
|
|
|
func getUserData(promptText string) string {
|
|
fmt.Print(promptText)
|
|
var value string
|
|
fmt.Scan(&value)
|
|
return value
|
|
}
|