title: How to avoid import cycles in mock generation?
body: <p>Simple example.</p>
  
  <p>I have package xxx. This package contains:</p>
  
  <ul>
  <li>struct A</li>
  <li>interface B which is a field of A</li>
  <li><p>struct C which is an argument in method of B</p>
  
  <pre><code>type A struct {
      SomeField B
  }
  
  type B interface {
      SomeMethod(c C)
  }
  </code></pre></li>
  </ul>
  
  <p>Now imagine I want to create unit test for structure A and mock dependency B. For creating mock I am using mock generator. All mocks are stored in the common "mocks" folder. </p>
  
  <p>The problem is that generated mock has a dependency on xxx package. This is happening because SomeMethod of interface B has argument xxx.C.</p>
  
  <p>Whenever I try to import my mock structure in a_test.go it fails because of cycle import problem. xxx package importing mocks package in the a_test.go. and mocks package imports xxx package in my generated mock.</p>
  
  <p>I need a peace of advice, what is the best workaround for this? Maybe my approach is not idiomatic enough. Where do you store your mocks?</p>