code: func (imp *imports) AddImportsFrom(t types.Type) {
  	switch el := t.(type) {
  	case *types.Basic:
  	case *types.Slice:
  		imp.AddImportsFrom(el.Elem())
  	case *types.Pointer:
  		imp.AddImportsFrom(el.Elem())
  	case *types.Named:
  		pkg := el.Obj().Pkg()
  		if pkg == nil {
  			return
  		}
  		if pkg.Name() == imp.currentpkg {
  			return
  		}
  		imp.imp[cleanImportPath(pkg.Path())] = pkg.Name()
  	case *types.Tuple:
  		for i := 0; i < el.Len(); i++ {
  			imp.AddImportsFrom(el.At(i).Type())
  		}
  	default:
  	}
  }
docs: // AddImportsFrom adds imports used in the passed type