lostluck commented on pull request #12903: URL: https://github.com/apache/beam/pull/12903#issuecomment-699292528
Heh no worries. On Fri, Sep 25, 2020, 8:18 PM Daniel Oliveira <[email protected]> wrote: > *@youngoli* commented on this pull request. > ------------------------------ > > In sdks/go/pkg/beam/core/runtime/genx/genx.go > <https://github.com/apache/beam/pull/12903#discussion_r495407788>: > > > + for _, t := range ts { > + runtime.RegisterType(t) > + } > +} > + > +// registerDoFn returns all types associated with the provided DoFn. > +// If passed a functional DoFn, the first return is a Function to > +// register with runtime.RegisterFunction. > +// The second return is all types to register with runtime.RegisterType. > +// Returns an error if the passed in values are not DoFns. > +func registerDoFn(dofn interface{}) (interface{}, []reflect.Type, error) { > + if rt, ok := dofn.(reflect.Type); ok { > + if rt.Kind() == reflect.Ptr { > + rt = rt.Elem() > + } > + dofn = reflect.New(rt).Interface() > > Oh, duh. I had a brain-fart that this statement only happens if the dofn > is a reflect.Type. I was imagining turning an actual DoFn instance into a > reflect.Type and back. Makes complete sense now. > > — > You are receiving this because you modified the open/close state. > Reply to this email directly, view it on GitHub > <https://github.com/apache/beam/pull/12903#discussion_r495407788>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/ADKDOFOLZ77ACW4VD36USQTSHVMPHANCNFSM4RV745WQ> > . > ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
