lostluck commented on a change in pull request #15057:
URL: https://github.com/apache/beam/pull/15057#discussion_r662660096
##########
File path: website/www/site/content/en/documentation/programming-guide.md
##########
@@ -675,10 +746,31 @@ the types of the input and output elements. If your
`DoFn` processes incoming
look like this:
{{< /paragraph >}}
+{{< paragraph class="language-go" >}}
+A `DoFn` processes one element at a time from the input `PCollection`. When you
+create a `DoFn` struct, you'll need to provide type parameters that match
+the types of the input and output elements in a ProcessElement method.
+If your `DoFn` processes incoming `string` elements and produces `int` elements
+for the output collection (like our previous example, `ComputeWordLengthFn`),
your dofn could
+look like this:
+{{< /paragraph >}}
+
{{< highlight java >}}
static class ComputeWordLengthFn extends DoFn<String, Integer> { ... }
{{< /highlight >}}
+{{< highlight go >}}
+type ComputeWordLengthFn struct{}
Review comment:
I was 50/50 on including full Go comment in some of the examples. Since
this is first one it does make sense in some way to include them. I worry that
they could be a distracting detail though.
--
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]