title: Golang: Type aliasing Structures That Meet a Interface Requirement
body: <p>See code below:</p>
  
  <p>I have an odd behavior that I can't understand in Golang. If I want to create a type alias of a structure and that structure meets the requirements of a interface type, then the type alias won't meet the requirements of that interface type. I have no idea why this is happening. Any thoughts?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  type MyInt struct {
      value int
  }
  
  func (m MyInt) DoubleIt() int {
      return m.value * 2
  }
  
  type MyInter interface {
      DoubleIt() int
  }
  
  type MyIntContainer struct {
      d MyInter
  }
  
  type MC MyIntContainer
  type MI MyInt
  
  func main() {
      e1 := MyIntContainer{MyInt{12}} //This is OK
      fmt.Printf("%d\n", e1.d.DoubleIt())
      e2 := MC{MI{12}} //this fails with error - line 29
      fmt.Printf("%d\n", e2.d.DoubleIt())
  }
  </code></pre>
  
  <p>The error message:
  Line 29: cannot use MI literal (type MI) as type MyInter in field value:
  MI does not implement MyInter (missing DoubleIt method)</p>