Created
June 18, 2016 05:59
-
-
Save narenaryan/e82e6ba0273241bff23c2773118e0253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Person struct{ | |
| name string | |
| socialSecurityNumber string | |
| age uint | |
| } | |
| type PrivateTeacher struct{ | |
| Person | |
| role string | |
| salary int | |
| } | |
| type School struct{ | |
| PrivateTeacher | |
| schoolName string | |
| } | |
| func main() { | |
| naren := Person{name:"naren", socialSecurityNumber:"34-54-123-34", age:23} | |
| pt := PrivateTeacher{Person: naren, role: "computers teacher", salary: 25000} | |
| trinityConvent := School{PrivateTeacher: pt, schoolName: "Tinity Convent"} | |
| fmt.Println(trinityConvent) | |
| fmt.Println(trinityConvent.PrivateTeacher) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment