damondouglas commented on a change in pull request #15057:
URL: https://github.com/apache/beam/pull/15057#discussion_r658395186



##########
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:
       Suggested change:
   
   ```
   type ComputeWordLengthFn struct{}
   ```
   
   to
   
   ```
   // ComputeWordLengthFn is a DoFn that computes the word length of string 
elements.
   type ComputeWordLengthFn struct{}
   ```




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


Reply via email to