Skip to content

fix(examples): use go.work instead of replace directive#1682

Open
phlx0 wants to merge 1 commit intocharmbracelet:mainfrom
phlx0:fix/examples-go-work-replace-directive
Open

fix(examples): use go.work instead of replace directive#1682
phlx0 wants to merge 1 commit intocharmbracelet:mainfrom
phlx0:fix/examples-go-work-replace-directive

Conversation

@phlx0
Copy link
Copy Markdown

@phlx0 phlx0 commented Apr 21, 2026

The replace directive in examples/go.mod breaks go run when fetching from the module proxy:

$ go run charm.land/bubbletea/examples/doom-fire@latest
go: charm.land/bubbletea/examples/doom-fire@latest: The go.mod file for the module
providing named packages contains one or more replace directives. It must not contain
directives that would cause it to be interpreted differently than if it were the main module.

Dropped the replace and added go.work.example instead. Copy it to go.work for local dev — same effect, doesn't break remote runs.

Also added go.work and go.work.sum to .gitignore.

Closes #1681

The replace directive in examples/go.mod prevented users from running
examples remotely via `go run charm.land/bubbletea/examples/...@latest`.

Replace it with a go.work.example template that contributors can copy
to go.work locally. go.work and go.work.sum are now gitignored.

Fixes charmbracelet#1681
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.

Replace directive in examples/go.mod breaks 'go run charm.land/.../examples/...@latest'

1 participant