sf
This commit is contained in:
parent
8aceabf0f1
commit
2e763f0dd6
3
book_with_bridge/chat/go.mod
Normal file
3
book_with_bridge/chat/go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module main
|
||||
|
||||
go 1.24.5
|
||||
|
|
@ -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)
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user