go.mod go1.23

This commit is contained in:
visualfc
2025-05-04 21:33:53 +08:00
parent 8882c31eb4
commit e8a91696d6
7 changed files with 1529 additions and 1421 deletions

25
cl/_testgo/alias/in.go Normal file
View File

@@ -0,0 +1,25 @@
package main
type Point struct {
x float64
y float64
}
func (p *Point) Scale(factor float64) {
p.x *= factor
p.y *= factor
}
type MyPoint = Point
func (p *MyPoint) Move(dx, dy float64) {
p.x += dx
p.y += dy
}
func main() {
pt := &MyPoint{1, 2}
pt.Scale(2)
pt.Move(3, 4)
println(pt.x, pt.y)
}