Created
July 25, 2017 23:46
-
-
Save cep21/7a3d03e47d1aafb2f1fe72ac4c97eca3 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
type I interface { | |
Func() | |
} | |
type I2 interface { | |
Another() | |
} | |
type I3 interface { | |
Func() | |
Another() | |
} | |
// If half the functinos are in the base struct | |
type Iimpl struct{} | |
func (i *Iimpl) Func(){} | |
// And half are in the larger struct | |
type I2impl struct{ | |
wraps(Iimpl) | |
} | |
func (i *I2impl) Another(){} | |
x := I2impl{} | |
// Does that struct implement the combination interface? | |
_, isBoth := x.(I3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment