1
0
mirror of https://github.com/MADTeacher/go_basics.git synced 2025-11-23 21:34:47 +02:00

отредактирована 3 глава

This commit is contained in:
Stanislav Chernyshev
2025-06-04 18:38:52 +03:00
parent 70656cfad8
commit f97178b439
64 changed files with 1751 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package main
import (
"fmt"
"golang/factory/shape"
)
func main() {
myShape := shape.Shape{
Name: "Cube",
Center: shape.Point{X: 4, Y: 5},
}
myShape1 := shape.Shape{"Triangle", shape.Point{1, 9}}
fmt.Printf("%+v\n", myShape) // {Name:Cube Center:{X:4 Y:5}}
fmt.Printf("%+v\n", myShape1) // {Name:Triangle Center:{X:1 Y:9}}
myShape.Center.Y = 2
myShape.Name = "Circle"
fmt.Printf("%+v\n", myShape) // {Name:Circle Center:{X:4 Y:2}}
}