title: golang struct not implementing interface?
body: <p>I am a beginner with go so bear with me on this. I have an interface defined as the following:</p>
  <pre><code>type DynamoTable interface {
      Put(item interface{}) interface{ Run() error }
  }
  </code></pre>
  <p>also I have a <code>Repo</code> struct like so:</p>
  <pre><code>type TenantConfigRepo struct {
      table DynamoTable
  }
  </code></pre>
  <p>and i have a struct <code>dynamo.Table</code> which has a <code>Put</code> function defined like so:</p>
  <pre><code>func (table dynamo.Table) Put(item interface{}) *Put
  </code></pre>
  <p>and the <code>Put</code> struct has a <code>Run</code> function as follows:</p>
  <pre><code>func (p *Put) Run() error
  </code></pre>
  <p>What I am trying to do is have a generic <code>DynamoTable</code> interface which will then be used for mocking and unit tests. however this is causing an issue with creating a new Repo:</p>
  <pre><code>func newDynamoDBConfigRepo() *TenantConfigRepo {
      sess := session.Must(session.NewSession())
      db := dynamo.New(sess)
      table := db.Table(tableName) //=&gt; this returns a type dynamo.Table
      return &amp;TenantConfigRepo{
          table: table,
      }
  }
  </code></pre>
  <p>This however is throwing an error like so</p>
  <p><code>cannot use table (variable of type dynamo.Table) as DynamoTable value in struct literal: wrong type for method Put (have func(item interface{}) *github.com/guregu/dynamo.Put, want func(item interface{}) interface{Run() error})</code></p>
  <p>this is very strange for me because from what i see is the interface that has a <code>Run() error</code> should be sufficient for the <code>Put</code> struct since it has the same signature. I am not sure what i am doing wrong here.</p>
  <p>Thanks!.</p>