code: func NewGenerator(pkg, iface string) (*Generator, error) {
  	p, err := importer.DefaultWithTestFiles().Import(pkg)
  	if err != nil {
  		return nil, err
  	}
  	obj := p.Scope().Lookup(iface)
  	if obj == nil {
  		return nil, fmt.Errorf("interface %s missing", iface)
  	}
  	if !types.IsInterface(obj.Type()) {
  		return nil, fmt.Errorf("%s should be an interface, was %s", iface, obj.Type())
  	}
  	g := &Generator{
  		ifaceName: iface,
  		pkg:       p,
  		iface:     obj.Type().Underlying().(*types.Interface).Complete(),
  	}
  	g.SetTemplate(defaultMockTemplate)
  	return g, nil
  }
docs: // NewGenerator initializes a Generator that will mock the given interface from the specified package.