You can use fmt.Scanf
with a format specifier. The format specifier for the integer is %d. So you can use standard input like below.
func main() {
var someVar int
fmt.Scanf("%d", &someVar)
}
or else you can use fmt.Scan
or fmt.Scanln
as below.
func main() {
var someVar int
fmt.Scanln(&someVar)
}