Go Cheatsheet - Get User Input from Stdin
Get User Input from Stdin
Scanln & Scanf
var name string
fmt.Scanln(&name) // this will scan only one string token (if there is a space in your string)
var age int
fmt.Scanf("%d\n", &age)
bufio.NewScanner
sc := bufio.NewScanner(os.Stdin)
sc.Scan()...
hn.0xbf.me1 min read