title: Pass struct for function that accepts a interface
body: <p>I have the following code:</p>
  
  <pre><code>package main
  
  
  type MyInterface interface {
      Test()
  }
  
  type MyType struct {
  
  }
  func (m MyType) Test(){}
  
  func AcceptInterface(i *MyInterface){
  }
  
  func main() {
  
      object := &amp;MyType{}
      AcceptInterface(object)
  }
  </code></pre>
  
  <p>I was expecting this to work, because MyType implements MyInterface, but I get:</p>
  
  <blockquote>
    <p>cannot use object (type *MyType) as type *MyInterface in argument to
    AcceptInterface:  *MyInterface is pointer to interface, not interface</p>
  </blockquote>
  
  <p>I tried doing type assertion: object.(MyInterface), but that doesn't work either.</p>
  
  <p>How can I accomplish this?</p>