Scan int
package main
import "fmt"
func main() {
var number int
fmt.Print("Type in a number: ")
fmt.Scan(&number)
fmt.Println(number)
}
- Accepts an integer
- Accepts a single character (and gives 0) but the second character is left on the SDTIN buffer
- TODO: try also with int8 type