Created
November 20, 2019 10:28
-
-
Save Mayankgupta688/f29fc92909582172fa0b0277b672c75e to your computer and use it in GitHub Desktop.
This file contains 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
type Person struct { | |
name string | |
age string | |
user Employee | |
} | |
// Assigning Object of type "Manager" to "user" Property | |
newPerson := Person{name: "Mayank", age: "32", Manager{Name: "Mayank", Age: 30, Designation: "Developer" Salary: 10}} | |
// Assigning Object of type "Lead" to "user" Property | |
newPerson := Person{name: "Mayank", age: "32", Lead{Name: "Mayank", Age: 30, TeamSize: "30" Salary: 10}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment