1、指针的示意图
package main import "fmt" func swap(pa *int,pb *int) { var temp int temp = *pa *pa = *pb *pb = temp } func main() { var a int = 10 var b int = 20 swap(&a,&b) fmt.Println("a = ",a,"b = ",b) }