Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Created November 20, 2019 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mayankgupta688/f29fc92909582172fa0b0277b672c75e to your computer and use it in GitHub Desktop.
Save Mayankgupta688/f29fc92909582172fa0b0277b672c75e to your computer and use it in GitHub Desktop.
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