From 53c61a20972420b5016b4ca1b28751a587982088 Mon Sep 17 00:00:00 2001 From: Robert Burke Date: Thu, 3 Mar 2022 11:45:04 -0800 Subject: [PATCH] [Cleanup] Update pre-v2 go package references (#17002) --- sdks/go/pkg/beam/core/runtime/harness/datamgr.go | 2 +- .../pkg/beam/core/runtime/harness/datamgr_test.go | 2 +- sdks/go/pkg/beam/core/runtime/harness/statemgr.go | 2 +- sdks/go/pkg/beam/util/gcsx/gcs.go | 2 +- .../content/en/documentation/programming-guide.md | 8 ++++---- .../documentation/resources/learning-resources.md | 2 +- .../www/site/content/en/documentation/sdks/go.md | 2 +- .../site/content/en/get-started/quickstart-go.md | 8 ++++---- .../site/content/en/get-started/try-apache-beam.md | 10 +++++----- .../content/en/get-started/wordcount-example.md | 14 +++++++------- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sdks/go/pkg/beam/core/runtime/harness/datamgr.go b/sdks/go/pkg/beam/core/runtime/harness/datamgr.go index 402310d10f205..dd4d26e9a11ab 100644 --- a/sdks/go/pkg/beam/core/runtime/harness/datamgr.go +++ b/sdks/go/pkg/beam/core/runtime/harness/datamgr.go @@ -492,7 +492,7 @@ func (w *dataWriter) send(msg *fnpb.Elements) error { for err == nil { // Per GRPC stream documentation, if there's an EOF, we must call Recv // until a non-nil error is returned, to ensure resources are cleaned up. - // https://godoc.org/google.golang.org/grpc#ClientConn.NewStream + // https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream _, err = w.ch.client.Recv() } } diff --git a/sdks/go/pkg/beam/core/runtime/harness/datamgr_test.go b/sdks/go/pkg/beam/core/runtime/harness/datamgr_test.go index 5c09440e61605..465662bcd5b72 100644 --- a/sdks/go/pkg/beam/core/runtime/harness/datamgr_test.go +++ b/sdks/go/pkg/beam/core/runtime/harness/datamgr_test.go @@ -92,7 +92,7 @@ func (f *fakeDataClient) Send(*fnpb.Elements) error { // We skip errors on the first call to test that errors can be returned // on the sentinel value send in dataWriter.Close // Otherwise, we return an io.EOF similar to semantics documented - // in https://godoc.org/google.golang.org/grpc#ClientConn.NewStream + // in https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream if f.skipFirstError && f.err != nil { f.skipFirstError = false return nil diff --git a/sdks/go/pkg/beam/core/runtime/harness/statemgr.go b/sdks/go/pkg/beam/core/runtime/harness/statemgr.go index 2e3c76cbcec22..8becf139c5a18 100644 --- a/sdks/go/pkg/beam/core/runtime/harness/statemgr.go +++ b/sdks/go/pkg/beam/core/runtime/harness/statemgr.go @@ -412,7 +412,7 @@ func (c *StateChannel) write(ctx context.Context) { for err == nil { // Per GRPC stream documentation, if there's an EOF, we must call Recv // until a non-nil error is returned, to ensure resources are cleaned up. - // https://godoc.org/google.golang.org/grpc#ClientConn.NewStream + // https://pkg.go.dev/google.golang.org/grpc#ClientConn.NewStream _, err = c.client.Recv() } } diff --git a/sdks/go/pkg/beam/util/gcsx/gcs.go b/sdks/go/pkg/beam/util/gcsx/gcs.go index 703eca4b2664f..2ce66c9ad00d0 100644 --- a/sdks/go/pkg/beam/util/gcsx/gcs.go +++ b/sdks/go/pkg/beam/util/gcsx/gcs.go @@ -30,7 +30,7 @@ import ( ) // NewClient creates a new GCS client with default application credentials, and supplied -// OAuth scope. The OAuth scopes are defined in https://godoc.org/cloud.google.com/go/storage#pkg-constants. +// OAuth scope. The OAuth scopes are defined in https://pkg.go.dev/cloud.google.com/go/storage#pkg-constants. func NewClient(ctx context.Context, scope string) (*storage.Client, error) { return storage.NewClient(ctx, option.WithScopes(scope)) } diff --git a/website/www/site/content/en/documentation/programming-guide.md b/website/www/site/content/en/documentation/programming-guide.md index 39ec60471f03a..02adfeb92b037 100644 --- a/website/www/site/content/en/documentation/programming-guide.md +++ b/website/www/site/content/en/documentation/programming-guide.md @@ -6982,7 +6982,7 @@ When an SDK-specific wrapper isn't available, you will have to access the cross- #### 13.2.3. Using cross-language transforms in a Go pipeline If a Go-specific wrapper for a cross-language is available, use that. Otherwise, you have to use the -lower-level [CrossLanguage](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#CrossLanguage) +lower-level [CrossLanguage](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguage) function to access the transform. **Expansion Services** @@ -7021,10 +7021,10 @@ When an SDK-specific wrapper isn't available, you will have to access the cross- Refer to [Creating cross-language transforms](#create-x-lang-transforms) for details. 3. Use the `beam.CrossLanguage` function in your pipeline as appropriate. Reference the URN, payload, expansion service address, and define inputs and outputs. You can use the - [beam.CrossLanguagePayload](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#CrossLanguagePayload) + [beam.CrossLanguagePayload](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#CrossLanguagePayload) function as a helper for encoding a payload. You can use the - [beam.UnnamedInput](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#UnnamedInput) and - [beam.UnnamedOutput](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam#UnnamedOutput) + [beam.UnnamedInput](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#UnnamedInput) and + [beam.UnnamedOutput](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam#UnnamedOutput) functions as shortcuts for single, unnamed inputs/outputs or define a map for named ones. ```go diff --git a/website/www/site/content/en/documentation/resources/learning-resources.md b/website/www/site/content/en/documentation/resources/learning-resources.md index 6cfce850ff56a..afa87ee82d3f2 100644 --- a/website/www/site/content/en/documentation/resources/learning-resources.md +++ b/website/www/site/content/en/documentation/resources/learning-resources.md @@ -145,7 +145,7 @@ complexity. Beam Katas are available for both Java and Python SDKs. * **[Java API Reference](https://beam.apache.org/documentation/sdks/javadoc/)** - Official API Reference for the Java SDK. * **[Python API Reference](https://beam.apache.org/documentation/sdks/pydoc/)** - Official API Reference for the Python SDK. -* **[Go API Reference](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam)** - Official API Reference for the Go SDK. +* **[Go API Reference](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam)** - Official API Reference for the Go SDK. ## Feedback and Suggestions {#feedback-and-suggestions} diff --git a/website/www/site/content/en/documentation/sdks/go.md b/website/www/site/content/en/documentation/sdks/go.md index 6d2c9efe72582..7e0c739355427 100644 --- a/website/www/site/content/en/documentation/sdks/go.md +++ b/website/www/site/content/en/documentation/sdks/go.md @@ -24,7 +24,7 @@ It is based on the following [design](https://s.apache.org/beam-go-sdk-design-rf Get started with the [Beam Go SDK quickstart](/get-started/quickstart-go) to set up your development environment and run an example pipeline. Then, read through the [Beam programming guide](/documentation/programming-guide) to learn the basic concepts that apply to all SDKs in Beam. -See the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam) for more detailed information. +See the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam) for more detailed information. ## Status diff --git a/website/www/site/content/en/get-started/quickstart-go.md b/website/www/site/content/en/get-started/quickstart-go.md index 3d5a13c198e54..a9d6e84eed45e 100644 --- a/website/www/site/content/en/get-started/quickstart-go.md +++ b/website/www/site/content/en/get-started/quickstart-go.md @@ -51,12 +51,12 @@ required arguments described in the examples. For example, to run `wordcount`, run: {{< runner direct >}} -$ go install github.com/apache/beam/sdks/go/examples/wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount $ wordcount --input --output counts {{< /runner >}} {{< runner dataflow >}} -$ go install github.com/apache/beam/sdks/go/examples/wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount # As part of the initial setup, for non linux users - install package unix before run $ go get -u golang.org/x/sys/unix $ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \ @@ -75,7 +75,7 @@ $ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \ $ ./gradlew :runners:spark:3:job-server:runShadow -PsparkMasterUrl=spark://localhost:7077 # In a separate terminal, run: -$ go install github.com/apache/beam/sdks/go/examples/wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount $ wordcount --input \ --output counts \ --runner spark \ @@ -85,7 +85,7 @@ $ wordcount --input \ ## Next Steps * Learn more about the [Beam SDK for Go](/documentation/sdks/go/) - and look through the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/go/pkg/beam). + and look through the [godoc](https://pkg.go.dev/github.com/apache/beam/sdks/v2/go/pkg/beam). * Walk through these WordCount examples in the [WordCount Example Walkthrough](/get-started/wordcount-example). * Take a self-paced tour through our [Learning Resources](/documentation/resources/learning-resources). * Dive in to some of our favorite [Videos and Podcasts](/documentation/resources/videos-and-podcasts). diff --git a/website/www/site/content/en/get-started/try-apache-beam.md b/website/www/site/content/en/get-started/try-apache-beam.md index e7d05c71b9126..80682e303ae6e 100644 --- a/website/www/site/content/en/get-started/try-apache-beam.md +++ b/website/www/site/content/en/get-started/try-apache-beam.md @@ -121,12 +121,12 @@ import ( "fmt" "regexp" - "github.com/apache/beam/sdks/go/pkg/beam" - "github.com/apache/beam/sdks/go/pkg/beam/io/textio" - "github.com/apache/beam/sdks/go/pkg/beam/runners/direct" - "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats" + "github.com/apache/beam/sdks/v2/go/pkg/beam" + "github.com/apache/beam/sdks/v2/go/pkg/beam/io/textio" + "github.com/apache/beam/sdks/v2/go/pkg/beam/runners/direct" + "github.com/apache/beam/sdks/v2/go/pkg/beam/transforms/stats" - _ "github.com/apache/beam/sdks/go/pkg/beam/io/filesystem/local" + _ "github.com/apache/beam/sdks/v2/go/pkg/beam/io/filesystem/local" ) var ( diff --git a/website/www/site/content/en/get-started/wordcount-example.md b/website/www/site/content/en/get-started/wordcount-example.md index 5faf05f5e6978..465b2c25bd073 100644 --- a/website/www/site/content/en/get-started/wordcount-example.md +++ b/website/www/site/content/en/get-started/wordcount-example.md @@ -65,7 +65,7 @@ python -m apache_beam.examples.wordcount_minimal --input YOUR_INPUT_FILE --outpu {{< /highlight >}} {{< highlight go >}} -$ go install github.com/apache/beam/sdks/go/examples/minimal_wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/minimal_wordcount $ minimal_wordcount {{< /highlight >}} @@ -434,7 +434,7 @@ To view the full code in Python, see **To run this example in Go:** {{< runner direct >}} -$ go install github.com/apache/beam/sdks/go/examples/wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount $ wordcount --input --output counts {{< /runner >}} @@ -451,7 +451,7 @@ This runner is not yet available for the Go SDK. {{< /runner >}} {{< runner dataflow >}} -$ go install github.com/apache/beam/sdks/go/examples/wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/wordcount # As part of the initial setup, for non linux users - install package unix before run $ go get -u golang.org/x/sys/unix $ wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \ @@ -760,7 +760,7 @@ To view the full code in Python, see **To run this example in Go:** {{< runner direct >}} -$ go install github.com/apache/beam/sdks/go/examples/debugging_wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/debugging_wordcount $ debugging_wordcount --input --output counts {{< /runner >}} @@ -777,7 +777,7 @@ This runner is not yet available for the Go SDK. {{< /runner >}} {{< runner dataflow >}} -$ go install github.com/apache/beam/sdks/go/examples/debugging_wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/debugging_wordcount # As part of the initial setup, for non linux users - install package unix before run $ go get -u golang.org/x/sys/unix $ debugging_wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \ @@ -1088,7 +1088,7 @@ To view the full code in Python, see **To run this example in Go:** {{< runner direct >}} -$ go install github.com/apache/beam/sdks/go/examples/windowed_wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/windowed_wordcount $ windowed_wordcount --input --output counts {{< /runner >}} @@ -1105,7 +1105,7 @@ This runner is not yet available for the Go SDK. {{< /runner >}} {{< runner dataflow >}} -$ go install github.com/apache/beam/sdks/go/examples/windowed_wordcount +$ go install github.com/apache/beam/sdks/v2/go/examples/windowed_wordcount # As part of the initial setup, for non linux users - install package unix before run $ go get -u golang.org/x/sys/unix $ windowed_wordcount --input gs://dataflow-samples/shakespeare/kinglear.txt \