Created
September 10, 2014 15:35
-
-
Save srt32/04b27dde11f99f68a3bf to your computer and use it in GitHub Desktop.
golang: ambiguous selector when embedding structs with conflicting method names
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 | |
func main() { | |
>> car{}.Model() | |
} | |
type car struct { | |
vehicle | |
boat | |
} | |
func (c *car) dostuff() { | |
>> c.Model | |
} | |
type boat interface { | |
Model() | |
} | |
type vehicle interface { | |
Model() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment