32 lines
442 B
Go
32 lines
442 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("Глава 8 - Это struct")
|
|
|
|
// var myStruct struct {
|
|
// number float64
|
|
// word string
|
|
// toggle bool
|
|
// }
|
|
// fmt.Printf("myStruct - %#v\n", myStruct)
|
|
|
|
type myType struct {
|
|
name string
|
|
age int
|
|
active bool
|
|
}
|
|
|
|
person := myType{
|
|
name: "Archie Fox",
|
|
age: 49,
|
|
active: true,
|
|
}
|
|
|
|
// fmt.Printf("Person - %#v\n", person)
|
|
fmt.Println(person.name)
|
|
}
|