Repository navigation
Add Go Standalone Activities quickstart snippets - #311
Merged
Merged
Conversation
Wrap the Activity and Worker files, the starter's ExecuteActivity call, and a new start-by-name path in Snipsync markers so the Go quickstart page can sync them instead of hand-typing the code. Switch the Worker and starter to envconfig so the same code connects to a local dev server or Temporal Cloud, as the quickstart page says.
Matches the other whole-file Go snippets, so the synced code blocks don't end with an empty line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Lets the Go Standalone Activities quickstart sync its code from
go-sandbox/activities/standalone/instead of hand-typing it. That page is the last Quickstart page with hand-typed SDK code (temporalio/documentation#5105).activity.goandworker/main.goin whole-file snippets (go-standalone-activity-quickstart-activity,go-standalone-activity-quickstart-worker).ExecuteActivitycall ingo-standalone-activity-quickstart-execute.-command start-by-namepath that starts the Activity by its type name, with the call ingo-standalone-activity-quickstart-execute-by-name.client.Options{}toenvconfig.MustLoadDefaultClientOptions(). The quickstart's "Run with Temporal Cloud" section says every sample on the page uses envconfig, so the same code works against a dev server and Temporal Cloud.The whole-file snippets put
// @@@SNIPENDright after the closing brace, like the other whole-file Go snippets, sogofmt -llists those two files, as it does the existing ones.The four snippets the Go feature guide already uses (
go-standalone-activity-get-result,-get-handle,-list,-count) are unchanged. Snipsync doesn't nest snippets, so the new markers sit outside them.Companion docs PR: temporalio/documentation#5803 (draft until this merges).
Local checks
From
go-sandbox/:End to end against
temporal server start-dev(CLI 1.10.1, Server 1.32.2), withTEMPORAL_ADDRESSset: