1
0
mirror of https://github.com/MADTeacher/go_basics.git synced 2025-11-29 05:36:55 +02:00
Files

14 lines
357 B
Go
Raw Permalink Normal View History

package main
import (
"fmt"
"golang/factory/shape"
)
func main() {
myShape1 := shape.NewShape("Cube", "Gold", 4, 5)
myShape2 := shape.NewShapeWithPoint("Circle", "Green", shape.Point{X: 5, Y: 7})
fmt.Printf("%+v\n", myShape1) // {Name:Cube Center:{X:4 Y:5} color:Gold}
fmt.Printf("%+v\n", *myShape2) // {Name:Circle Center:{X:5 Y:7} color:Green}
}