Skip to content

fix(go,cli,mockserver,terraform): bump staticcheck to v0.8.2 for Go 1.27.2 - #214

Merged
ThomasRooney merged 1 commit into
mainfrom
fix/staticcheck-go-1-27-2
Nov 12, 2026
Merged

ThomasRooney merged 1 commit into
mainfrom
fix/staticcheck-go-1-27-2

Conversation

@ThomasRooney

@ThomasRooney ThomasRooney commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Why

After generating a Go-based target, the generator lints the output with go run honnef.co/go/tools/cmd/staticcheck@v0.8.1. Go 1.27.2 changed the compiler export data format, which staticcheck v0.8.1 cannot read, so with a Go 1.27.2+ toolchain the lint step fails and generation exits non-zero:

-: internal error in importing "internal/byteorder" (cannot decode "internal/byteorder", export data version 5 is greater than maximum supported version 4); please report an issue (compile)
ERROR	lint failed: exit status 1

Generation with Go 1.26.x is unaffected. staticcheck 2026.2.2 (v0.8.2) adds support for the Go 1.27.2 export data format.

What changed

  • Bump the staticcheck pin from v0.8.1 to v0.8.2 in the lint configuration of the go, cli, mockserver and terraform targets. The -checks flags are unchanged.
  • Changeset: core / go, cli, mockserver, terraform, patch.

The pin is only used by the generator's lint step and is not written into generated output, so the review SDKs do not change.

Testing

Each case generates from a small OpenAPI document and lets the generator run its own compile and lint steps.

Case Go toolchain Before (v0.8.1) After (v0.8.2)
go 1.27.2 exit 1, export data error at lint exit 0, lint clean
cli 1.27.2 exit 1, export data error at lint exit 0, lint clean
terraform (document with one x-speakeasy-entity) 1.27.2 exit 1, export data error at lint exit 0, lint clean
go with generateTests / generateNewTests (SDK lint, then mock server lint) 1.27.2 exit 1 at SDK lint, mock server lint not reached exit 0, both lints clean
mock server lint command run directly on generated tests/mockserver 1.27.2 exit 1, export data error exit 0
go 1.26.10 not run (known working) exit 0, lint clean

staticcheck v0.8.2 reported no new findings on any of the generated output above.

Not run locally, left to CI: make lint, npm run format, make check-template-*, and the full make test-* suites against the larger test specs. The change is a version string inside existing string literals.

Public-safety check

  • This change contains no credentials, customer documents, private repository URLs, private filesystem paths, or unredacted private logs.
  • Title, body, comments, and commit messages name no customers or customer-derived identifiers, private paths or trackers, or workflow provenance, and are understandable without private context (.claude/skills/public-repo-communication/SKILL.md).
  • Generated fixtures and review SDK changes are public-safe.
  • I reviewed git diff --check.

Summary by cubic

Bumps the staticcheck pin from v0.8.1 to v0.8.2 in the go, cli, mockserver, and terraform target lint configurations. Go 1.27.2 changed the compiler export data format, which v0.8.1 cannot read, so the post-generation lint step failed with an export data version error whenever the local toolchain was Go 1.27.2 or newer; v0.8.2 supports the new format. Go 1.26.x is unaffected, and the -checks flags are unchanged. The pin only affects the generator's lint step and is not written into generated output, so generated SDKs do not change.

Written for commit a4407e1. Summary will update on new commits.

View guided diff Turn on auto-fix

@ThomasRooney
ThomasRooney requested a review from a team as a code owner November 12, 2026 13:25
@ThomasRooney
ThomasRooney requested a review from 2ynn November 12, 2026 13:26
@github-actions github-actions Bot added go Trigger (90) snapshot tests for go mockserver terraform Trigger (12) snapshot tests for terraform labels Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Bumps the staticcheck pin from v0.8.1 to v0.8.2 in the go, cli, mockserver, and terraform lint configs so post-generation lint works with Go 1.27.2. The -checks flags are unchanged and the pin is not emitted into generated output, making this a bounded tooling-version fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@ThomasRooney
ThomasRooney force-pushed the fix/staticcheck-go-1-27-2 branch from 698db82 to 31d11f7 Compare November 12, 2026 13:27
@speakeasy-generator-bot

speakeasy-generator-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Generator Snapshot Testing

Selector(s) Result Summary
snapshot-go, snapshot-terraform ✅ Snapshot run completed

Snapshot results: https://github.com/speakeasy-api/openapi-generation-snapshots/issues/167#issuecomment-6826719686

Snapshot results are summarized above. Additional run context is linked for maintainers with access.

….27.2

Go 1.27.2 changed the compiler export data format. staticcheck v0.8.1
cannot read it, so the post-generation lint step failed with
"export data version 5 is greater than maximum supported version 4"
whenever the local toolchain was Go 1.27.2 or newer. staticcheck v0.8.2
(2026.2.2) supports the new format.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ThomasRooney
ThomasRooney force-pushed the fix/staticcheck-go-1-27-2 branch from 31d11f7 to a4407e1 Compare November 12, 2026 13:35
@ThomasRooney
ThomasRooney added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 3aebe65 Nov 12, 2026
169 checks passed
@ThomasRooney
ThomasRooney deleted the fix/staticcheck-go-1-27-2 branch November 12, 2026 15:43
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

go Trigger (90) snapshot tests for go mockserver terraform Trigger (12) snapshot tests for terraform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants