title: How to implement interface method with return type is an interface in Golang
body: <p>Here is my code:</p>
  
  <pre><code>type IA interface {
      FB() IB
  }
  
  type IB interface {
      Bar() string
  }
  
  type A struct {
      b *B
  }
  
  func (a *A) FB() *B {
      return a.b
  }
  
  type B struct{}
  
  func (b *B) Bar() string {
      return "Bar!"
  }
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>cannot use a (type *A) as type IA in function argument:
      *A does not implement IA (wrong type for FB method)
          have FB() *B
          want FB() IB
  </code></pre>
  
  <p>Here is the full code: <a href="http://play.golang.org/p/udhsZgW3W2">http://play.golang.org/p/udhsZgW3W2</a><br>
  I should edit the <strong>IA</strong> interface or modifi my <strong>A</strong> struct?<br>
  What if I define IA, IB in a other package (so I can share these interface), I must import my package and use the IB as returned type of A.FB(), is it right?</p>