title: How to resolve types into a primitives in AST parser
body: <p>I want to extract signatures of functions to be able generate some wrapper methods over them. For this, I'm using
  <code>golang.org/x/tools/go/packages</code> which provides me a possibility to read AST.</p>
  <p>For example, for the function <code>func MyFunc(param int)</code> definition, you receive some</p>
  <pre><code>ast.FuncDecl{
      Type: *FieldList{
          List: []*Field{
              {
                  Names: []*Ident{ /*...*/ },
                  Type:  nil, /*...*/
              },
          },
      },
  }
  </code></pre>
  <p>Where Type represents a type.</p>
  <p>I want to generate some special code for all <code>int</code> parameters, but int can be also hidden with some type declaration</p>
  <pre><code>type MyType int
  </code></pre>
  <p>How can I convert <code>ast</code> type to the real one that the compiler has?</p>