title: Go interface: Cannot assign value to unexported field
body: <p>I try to mock some struct for unit testing and I use following <a href="https://blog.codecentric.de/2019/07/gomock-vs-testify/#testifymock" rel="nofollow noreferrer">site</a></p>
  
  <p>I wrote following:</p>
  
  <p><strong>Doer</strong></p>
  
  <pre><code>package user
  
  import "errors"
  
  type Doer interface {
      Do(int, string) error
  }
  
  type DoerImp struct {
  
  }
  
  func (d *DoerImp)Do(val int, str string) error{
      if val == 3{
          return errors.New("Some error")
      }
      return nil
  }
  </code></pre>
  
  <p><strong>User</strong></p>
  
  <pre><code>package user
  
  type User struct {
      doer Doer
  }
  
  func (u *User) UseDoer() {
      u.doer.Do(1, "abc")
  }
  </code></pre>
  
  <p>And from the main I want to run this code:</p>
  
  <pre><code>c := &amp;user.DoerImp{}
  u := user.User{c}
  u.UseDoer()
  </code></pre>
  
  <p>However I get an error: <code>Cannot assign value to unexported field 'doer'</code></p>
  
  <p>What I'm doing wrong?<br>
  my <code>c</code> value has <code>Doer</code> interface signature</p>