jrmccluskey commented on a change in pull request #15057:
URL: https://github.com/apache/beam/pull/15057#discussion_r663110713
##########
File path: website/www/site/content/en/documentation/programming-guide.md
##########
@@ -716,11 +837,45 @@ static class ComputeWordLengthFn extends DoFn<String,
Integer> {
{{< code_sample "sdks/python/apache_beam/examples/snippets/snippets_test.py"
model_pardo_pardo >}}
{{< /highlight >}}
-{{< paragraph class="language-java" >}}
+{{< highlight go >}}
+{{< code_sample "sdks/go/examples/snippets/04transforms.go" model_pardo_pardo
>}}
+{{< /highlight >}}
+
+{{< paragraph class="language-go" >}}
+Simple DoFns can also be written as functions.
+{{< /paragraph >}}
+
+{{< highlight go >}}
+func ComputeWordLengthFn(word string, emit func(int)) { ... }
+
+func init() {
+ beam.RegisterFunction(ComputeWordLengthFn)
+}
+{{< /highlight >}}
+
+<span class="language-go" >
+
+> **Note:** Wether using a structural `DoFn` type or a functional `DoFn`, they
should be registered with
Review comment:
```suggestion
> **Note:** Whether using a structural `DoFn` type or a functional `DoFn`,
they should be registered with
```
--
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]