Skip to content

Commit

Permalink
Remove anonymous function from fileio.ReadMatches example (#29186)
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaojeling authored Oct 30, 2023
1 parent 84e6ceb commit 2f8eebb
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions sdks/go/pkg/beam/io/fileio/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,9 @@ func ExampleReadMatches() {
beam.Init()
p, s := beam.NewPipelineWithRoot()

pairFn := func(ctx context.Context, file fileio.ReadableFile, emit func(string, string)) error {
contents, err := file.ReadString(ctx)
if err != nil {
return err
}
emit(file.Metadata.Path, contents)
return nil
}

matches := fileio.MatchFiles(s, "gs://path/to/*.gz")
files := fileio.ReadMatches(s, matches)
pairs := beam.ParDo(s, pairFn, files)
debug.Print(s, pairs)
debug.Print(s, files)

if err := beamx.Run(context.Background(), p); err != nil {
log.Fatalf("Failed to execute job: %v", err)
Expand Down

0 comments on commit 2f8eebb

Please sign in to comment.