This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch users/damccorm/compactDocs
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/users/damccorm/compactDocs by
this push:
new 64d2be4dc07 Update go compact example
64d2be4dc07 is described below
commit 64d2be4dc070341d7007623d8b6500f39bef16b2
Author: Danny McCormick <[email protected]>
AuthorDate: Fri Nov 17 04:15:26 2023 -0800
Update go compact example
---
sdks/go/examples/snippets/04transforms.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sdks/go/examples/snippets/04transforms.go
b/sdks/go/examples/snippets/04transforms.go
index bb3abe3cf83..a9c28369198 100644
--- a/sdks/go/examples/snippets/04transforms.go
+++ b/sdks/go/examples/snippets/04transforms.go
@@ -332,6 +332,11 @@ func (fn *averageFn) ExtractOutput(a averageAccum) float64
{
return float64(a.Sum) / float64(a.Count)
}
+func (fn *averageFn) Compact(a averageAccum) averageAccum {
+ // No-op
+ return a
+}
+
func init() {
register.Combiner3[averageAccum, int, float64](&averageFn{})
}