mirror of
https://github.com/MADTeacher/go_basics.git
synced 2025-11-23 21:34:47 +02:00
22 lines
266 B
Go
22 lines
266 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
type point struct {
|
|
x int
|
|
y int
|
|
}
|
|
|
|
type shape struct {
|
|
name string
|
|
center point
|
|
}
|
|
|
|
func main() {
|
|
myShape := shape{
|
|
name: "Cube",
|
|
center: point{x: 10, y: 6},
|
|
}
|
|
fmt.Printf("%+v\n", myShape) // {name:Cube center:{x:10 y:6}}
|
|
}
|