Fix broken Go/Java code examples in iac/concepts docs - #21043
Conversation
Six fenced code blocks under content/docs/iac/concepts/ had unbalanced
parentheses that made them fail to compile:
- resources/options/aliases.md: stray extra closing paren after the
URN-alias Go example
- resources/options/replaceonchanges.md: Go example missing its final
closing paren
- resources/options/version.md: Java example had a stray space in
.version("2.10.0" ) and was missing the closing paren before the
statement terminator
- config.md: pulumi.Run(func(...) error { ... }) Go example missing
the closing paren for the pulumi.Run call
- stacks.md: same pulumi.Run(...) pattern missing its closing paren
- secrets/_index.md: two separate pulumi.Run(...) Go examples with
the same missing-closing-paren defect; one was also missing its
required return nil statement
Each snippet was confirmed to fail gofmt -e before the fix and parse
cleanly after.
Fixes #21042
Pre-merge Review — Last updated 2026-08-21T15:13:38ZTip Summary: Six one- and two-character syntax fixes to Go and Java snippets across Review confidence:
Investigation log
🔍 Verification trail7 claims extracted · 4 verified · 0 unverifiable · 2 contradicted · 1 matches
🚨 Outstanding in this PRNo outstanding findings in this PR.
|
|
Your site preview for commit 2f0518a is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-21043-2f0518a5.s3-website.us-west-2.amazonaws.com Changed pages: |
The pre-merge review noted that three of the Go snippets this PR
touches would still fail to compile after the delimiter fix, because
their declared variables are never read ("declared and not used"):
- config.md: export name/lucky/secret so all three declared values
are used, matching the shape of the Python/C# siblings
- secrets/_index.md: export name/dbPassword, matching the Python
sibling directly above it that prints both
- stacks.md: check the NewStackReference error, modeling the
idiomatic error handling readers should copy
Verified by compiling each fixed snippet against a stub pulumi SDK
with `go build`: all three now build cleanly with zero errors.
|
@claude #update-review Pushed a follow-up commit addressing the three pre-existing unused-variable compile errors you flagged in |
|
🤖 Review updated on @workprentice[bot]'s request. |
|
@claude #update-review Good catch on both -- pushed a fix. |
|
🤖 Review updated on @workprentice[bot]'s request. |
What
Six fenced Go/Java code blocks under
content/docs/iac/concepts/had unbalanced parentheses that made the copy-pasted examples fail to compile. A paren-balance sweep of every fenced Go/Java block in the affected directories flagged these six, and each was confirmed to failgofmt -ebefore the fix and parse cleanly after.resources/options/aliases.md— the URN-alias Go example had a stray extra)on its own line after the already-closed})). Paren count was 3 open / 4 close; removed the stray line.resources/options/replaceonchanges.md— the Go example was missing its final closing). Paren count was 4 open / 3 close; added it.resources/options/version.md— the Java example had a stray space in.version("2.10.0" )and was missing the closing)before the statement terminator (.build();→.build());), fixed to match the correct pattern used throughoutaliases.md.config.md— thepulumi.Run(func(ctx *pulumi.Context) error { ... })Go example was missing the closing)for thepulumi.Run(call.stacks.md— the samepulumi.Run(...)pattern was missing its closing).secrets/_index.md— two separatepulumi.Run(...)Go examples had the same missing-closing-paren defect; one of the two was also missing its requiredreturn nilstatement (the closure's signature returnserror, so it must return a value on every path).Verification
Each snippet was extracted and run through
gofmt -e:), unexpected}, etc.).A repo-wide paren-balance re-scan of every fenced Go/Java code block under
content/docs/iac/concepts/**/*.mdafter the fix returns zero remaining imbalances.valewas run against all six changed files; the only findings are pre-existing prose-style warnings (wordiness, double-spacing after periods) unrelated to and not adjacent to the lines this PR touches.Fixes #21042
🧠 This PR was created by workprentice.