title: Cannot use struct that implements interface
body: <p>code:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type implementation struct {
      d []int
  }
  
  func (impl *implementation) getData() interface{} {
      return impl.d
  }
  
  type phase struct{}
  
  type data interface {
      getData() interface{}
  }
  
  func MakeIntDataPhase() *phase {
      return &amp;phase{}
  }
  
  func (p *phase) run(population []data) []data {
      return nil
  }
  
  func main() {
      var population []implementation
      MyPhase := MakeIntDataPhase()
      fmt.Println(MyPhase.run(population))
  
  }
  </code></pre>
  
  <p>When running following code in playground I got following error: <code>prog.go:30:25: cannot use population (type []implementation) as type []data in argument to MyPhase.run</code></p>
  
  <p>I am new to golang and I don't understand why is this happening?</p>
  
  <p>Struct <code>implementation</code> implements method <code>getData()</code> from <code>data</code> interface. Isn't it enough to use  a slice of <code>implementation</code> in <code>run</code> method? </p>
  
  <p>Where my reasoning is wrong?</p>