code: func (g *Generator) pkgAlias(pkgPath string) string {
  	pkgPath = fixPkgPathVendoring(pkgPath)
  	if alias := g.imports[pkgPath]; alias != "" {
  		return alias
  	}
  
  	for i := 0; ; i++ {
  		alias := fixAliasName(path.Base(pkgPath))
  		if i > 0 {
  			alias += fmt.Sprint(i)
  		}
  
  		exists := false
  		for _, v := range g.imports {
  			if v == alias {
  				exists = true
  				break
  			}
  		}
  
  		if !exists {
  			g.imports[pkgPath] = alias
  			return alias
  		}
  	}
  }
docs: // pkgAlias creates and returns and import alias for a given package.