package main
import "fmt"
type Person struct {
Name string
Gender string
Age uint8
Address string
}
func(p *Person) Move(oldAddress string) (address string){
p.Address,address=oldAddress,p.Address
return
}
import "fmt"
type Person struct {
Name string
Gender string
Age uint8
Address string
}
func(p *Person) Move(oldAddress string) (address string){
p.Address,address=oldAddress,p.Address
return
}
2018-02-11
举例理解:
var array = [...] int {1, 2, 3, 4, 5, 6, 7}
slice1 = array[2:5:6] //那么slice1 = []int{3, 4, 5} , len(slice1) 等于3,cap(slice1) 等于5
var array = [...] int {1, 2, 3, 4, 5, 6, 7}
slice1 = array[2:5:6] //那么slice1 = []int{3, 4, 5} , len(slice1) 等于3,cap(slice1) 等于5
2018-01-31