Go type-error: struct does not implement interface : <pre><code>// BEGIN: external library

type realX struct {}

type realY struct {}

func (realX) Do() realY {
  return realY{}
}

// END

type A struct {
  a myX
}

type myY interface {}

type myX interface {
  Do() myY
}

func foo (arg1 myY) {
}

func main() {
    foo(realY{})
    x := A{realX{}}
    fmt.Println("Hello, playground")
}
</code></pre>

<p>I get:</p>

<pre><code>cannot use realX literal (type realX) as type myX in field value:
    realX does not implement myX (wrong type for Do method)
        have Do() realY
        want Do() myY
</code></pre>

<p>From the looks of it, realY implements myY, so why can't I do this? This is making it impossible to write mock unit tests cleanly.</p>
