Created
January 26, 2016 02:46
-
-
Save kidtronnix/da6ebdd6d5c2d95a3eae 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 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