Skip to content

Instantly share code, notes, and snippets.

@srt32
Created September 10, 2014 15:35
Show Gist options
  • Save srt32/04b27dde11f99f68a3bf to your computer and use it in GitHub Desktop.
Save srt32/04b27dde11f99f68a3bf to your computer and use it in GitHub Desktop.
golang: ambiguous selector when embedding structs with conflicting method names
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