blob: 80e7dcee350805690995b4ec9dc44642abf2c8d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// structs2
// Make me compile!
//
// I AM NOT DONE
package main
import "fmt"
type Person struct {
// don't just create the phone field here. embed a new struct
name string
age int
}
func main() {
// contactDetails := ContactDetails{}
person := Person{name: "John", age: 32}
fmt.Printf("%s is %d years old and his phone is %s\n", person.name, person.age, person.phone)
}
|