Skip to content

Fix the Go samples module build - #2648

Open
rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:fix/go-samples-build
Open

rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:fix/go-samples-build

Conversation

@rinceyuan

Copy link
Copy Markdown
Contributor

go/samples is a separate module that consumes the SDK through a replace github.com/github/copilot-sdk/go => ../ directive, so it needs go.sum entries for the SDK's own dependencies. Two are missing, and go build ./... in that directory fails.

Reproducing on main

$ cd go/samples && go build ./...
../copilot_request_handler.go:18:2: missing go.sum entry for module providing package
github.com/coder/websocket (imported by github.com/github/copilot-sdk/go); to add:
        go get github.com/github/copilot-sdk/go@v0.0.0

go vet ./... fails identically. The SDK requires the package, but the samples module never learned about it:

coder/websocket
go/go.mod required, v1.8.15
go/go.sum 2 entries
go/samples/go.sum 0 entries
go/samples/go.mod not listed

How it drifted

Date Change
2026-05-12 go/samples go.mod/go.sum last updated (#1252)
2026-06-23 #1689 added coder/websocket to the SDK — samples not updated

No workflow builds go/samples, so nothing caught it. The only CI reference to a samples directory is the step that refreshes the nodejs samples lockfile in update-copilot-dependency.yml.

The change

go mod tidy in go/samples, which adds the two indirect dependencies the SDK pulls in, with their hashes:

+ github.com/coder/websocket v1.8.15 // indirect
+ github.com/ebitengine/purego v0.10.1 // indirect

Both are already direct requirements of go/go.mod at exactly these versions.

Verification

$ cd go/samples && go build ./... && go vet ./...      # both exit 0

The main module is untouched and still builds:

$ git diff --stat -- go/go.mod go/go.sum
                      # (no output)
$ cd go && go build ./...                              # exit 0

Scope

Six added lines across the samples module's go.mod and go.sum; no deletions, no source changes, and no change to the main module. This only restores the build — I have not tried to add CI coverage for the samples, since where that belongs felt like your call.

go/samples builds the SDK through a replace directive, so it needs go.sum entries for the SDK's own dependencies. coder/websocket was added to the SDK in github#1689 and purego is likewise missing, so 'go build ./...' in go/samples has failed since then.
Copilot AI balanced review requested due to automatic review settings September 14, 2026 03:47
@rinceyuan
rinceyuan requested a review from a team as a code owner September 14, 2026 03:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The dependency versions and checksums match the main Go module and correctly restore sample-module resolution.

Pull request overview

Restores the standalone Go samples module’s build by declaring and checksumming SDK transitive dependencies.

Changes:

  • Adds indirect requirements for websocket and purego.
  • Adds their module checksums.
File summaries
File Description
go/samples/go.mod Declares the missing indirect dependencies.
go/samples/go.sum Records matching dependency checksums.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants