diff --git a/sdks/go/pkg/beam/create.go b/sdks/go/pkg/beam/create.go index 4ddc5396c724..d2bd554963ee 100644 --- a/sdks/go/pkg/beam/create.go +++ b/sdks/go/pkg/beam/create.go @@ -20,8 +20,14 @@ import ( "reflect" "github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors" + "github.com/apache/beam/sdks/v2/go/pkg/beam/register" ) +func init() { + register.DoFn2x1[[]byte, func(T), error]((*createFn)(nil)) + register.Emitter1[T]() +} + // Create inserts a fixed non-empty set of values into the pipeline. The values must // be of the same type 'A' and the returned PCollection is of type A. // diff --git a/sdks/go/pkg/beam/create_test.go b/sdks/go/pkg/beam/create_test.go index 3acfe779bba1..9033979d0502 100644 --- a/sdks/go/pkg/beam/create_test.go +++ b/sdks/go/pkg/beam/create_test.go @@ -26,6 +26,15 @@ import ( "github.com/golang/protobuf/proto" ) +func TestMain(m *testing.M) { + ptest.Main(m) +} + +func init() { + beam.RegisterType(reflect.TypeOf((*wc)(nil)).Elem()) + beam.RegisterType(reflect.TypeOf((*testProto)(nil)).Elem()) +} + type wc struct { K string V int