Skip to content

Instantly share code, notes, and snippets.

@kidtronnix
Created January 26, 2016 02:46
Show Gist options
  • Save kidtronnix/da6ebdd6d5c2d95a3eae to your computer and use it in GitHub Desktop.
Save kidtronnix/da6ebdd6d5c2d95a3eae to your computer and use it in GitHub Desktop.
package main
import "fmt"
type A struct {
OnlyForA string
}
func (a *A) Eyo() {
fmt.Println("eyo")
}
type B struct {
OnlyForB string
}
func (b *B) Boom() {
fmt.Println("Boom")
}
type C struct {
*A
*B
}
func main() {
a := A{
"AYo",
}
b := B{
"BO",
}
c := C{
&a,
&b,
}
fmt.Println(c.OnlyForA)
fmt.Println(c.OnlyForB)
c.Eyo()
c.Boom()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment