sf
This commit is contained in:
@@ -11,10 +11,10 @@ func (p *Point) Inc() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
points := []*Point{{1},{2},{3}}
|
||||
points := []Point{{1},{2},{3}}
|
||||
|
||||
for _,p := range points {
|
||||
p.Inc()
|
||||
for i := range points {
|
||||
points[i].Inc()
|
||||
}
|
||||
fmt.Println(points[0].x)
|
||||
}
|
||||
Reference in New Issue
Block a user