title: How to use a type definition in another file with swaggo?
body: <p>I am using <a href="https://github.com/swaggo/gin-swagger" rel="nofollow noreferrer">swaggo</a> generate API document based on <code>godoc</code> syntax.</p>
  <p>Source folder and files</p>
  <pre><code>|-post
  |--controller.go
  |--response.go
  </code></pre>
  <p>For this definition:</p>
  <pre><code>controller.go
  
  package post
  
  ...
  
  // Index godoc
  // @Summary Index Post
  // @Success 200 {array} []*Response
  // @Router /v1/posts [get]
  func Index(ctx *gin.Context) {
    ...
  }
  </code></pre>
  <p>The <code>Response</code> is been defined in an another file but the same package.</p>
  <pre><code>response.go
  
  package post
  
  // Response  is post response body
  type Response struct {
      ID   int64  `json:&quot;id&quot;`
      Name string `json:&quot;name&quot;`
  
      CreatedAt string `json:&quot;created_at&quot;`
      UpdatedAt string `json:&quot;updated_at&quot;`
  }
  </code></pre>
  <p>But when run <code>swag init</code> to generate swagger docs, it said:</p>
  <pre><code>2021/01/29 09:39:56 Generate swagger docs....
  2021/01/29 09:39:56 Generate general API Info, search dir:./
  2021/01/29 09:39:56 ParseComment error in file application/post/controller.go :cannot find type definition:
  </code></pre>
  <p>When I move the <code>Response</code> struct to <code>controller.go</code>, it works.</p>
  <p>How to import it with godoc or swaggo?</p>