lostluck commented on a change in pull request #15703:
URL: https://github.com/apache/beam/pull/15703#discussion_r726503099



##########
File path: sdks/go/pkg/beam/core/graph/fn.go
##########
@@ -385,6 +385,12 @@ func AsDoFn(fn *Fn, numMainIn mainInputs) (*DoFn, error) {
 
        if _, ok := fn.methods[processElementName]; !ok {
                err := errors.Errorf("failed to find %v method", 
processElementName)
+               if fn.Recv != nil {
+                       v := reflect.ValueOf(fn.Recv)
+                       if v.Kind() != reflect.Ptr {
+                               err = errors.Wrap(err, "structural DoFn passed 
by value, ensure that ProcessElement method is value receiving or have DoFn 
passed by pointer")

Review comment:
       ```suggestion
                                err = errors.Wrap(err, "structural DoFn passed 
by value, ensure that the ProcessElement method has a value receiver or pass 
the DoFn by pointer")
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to