package main import "fmt" // n is a copy; changing it doesn't affect the caller func tryDouble(n int) { n *= 2 } func main() { x := 5 tryDouble(x) fmt.Println(x) // still 5 }
a copy is handed to the callee