gonzojive commented on issue #21929:
URL: https://github.com/apache/beam/issues/21929#issuecomment-1159224235

   Thanks for sharing your thinking.
   
   One issue I punted on is the usage of `any` in `T any` below:
   
   ```go
   func Create[T any](scope beam.Scope, obj ...T) Collection[T] {
        asInterfaces := lo.Map(obj, func(elem T, _ int) any { return elem })
        untyped := beam.Create(scope, asInterfaces...)
        return Collection[T]{untyped}
   }
   ```
   
   It seems like the signature should be more like this to ensure things that 
can be encoded are being passed around:
   
   ```go
   func Create[T Serializable](scope beam.Scope, obj ...T) Collection[T] { /* 
... */ }
   ```


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