// populateGeneratedTypes finds top-level types that we will generate
// additional methods for.
populateGeneratedTypes finds top-level types that we will generate
additional methods for.
// populateGeneratedTypes finds top - level types that we will generate // additional methods for .
func (v *visitation) populateGeneratedTypes(scopes []*types.Scope) {
	for _, scope := range scopes {
		for _, name := range scope.Names() {
			obj := scope.Lookup(name)
			if named, ok := obj.Type().(*types.Named); ok {
				switch named.Underlying().(type) {
				case *types.Struct, *types.Interface:
					v.visitableType(obj.Type(), false)
				}
			}
		}
	}
}
func ( v * visitation ) populateGeneratedTypes ( scopes [ ] * types . Scope ) { for _ , scope := range scopes { for _ , name := range scope . Names ( ) { obj := scope . Lookup ( name ) if named , ok := obj . Type ( ) . ( * types . Named ) ; ok { switch named . Underlying ( ) . ( type ) { case * types . Struct , * types . Interface : v . visitableType ( obj . Type ( ) , false ) } } } } }
populateGeneratedTypes finds top-level types that we will generate
additional methods for.
populateGeneratedTypes finds top - level types that we will generate additional methods for .
// Bootstrap our type info by looking for named struct and interface // types in the package.