//Very new to Go and trying to understand why n holds the value 1.
//many thanks
func main() {
var y int
fmt.Println(y) //0
n,err:=fmt.Scanf("%d\n", &y)
if err != nil{
log.Fatal(err)
}
fmt.Println(“y =”,y)// prints the value of y
fmt.Println(“y+n =”,y+n) //some reason prints value of y + 1 where does the 1 come from? is n a bool?
fmt.Println(“n”,n) //1
fmt.Println(“y =”,y)
func Scanf(format string, a ...interface{}) (n int, err error)
Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format. It returns the number of items successfully scanned.