Thanks for helping improve message-bus. By contributing, you agree to abide by the code of conduct.
Search the issue tracker first; if nothing matches, open an issue. Bugs, ideas and usage questions are all welcome. For a bug, include what you published and subscribed, and what you expected to happen.
You need Go 1.26 or newer.
git clone https://github.com/vardius/message-bus.git
cd message-bus
go test ./...Before sending a pull request, run what CI runs:
gofmt -l .
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@v0.8.2 ./...
go test -race -shuffle=on ./...
go test -run Allocations -count 1 ./...bus.goholdsBus,New,Publish,SubscribeandClose;doc.gois the package documentation.- Concurrency tests run in
testing/synctestbubbles: they wait for goroutines to block instead of sleeping, time is fake, and a test fails if it leaves a goroutine behind. Keep new ones that way. examples/holds runnable programs, each with a test. The website shows them, so keep them short.website/is the documentation site.
TestAllocations fails if Publish allocates; if your change moves a number, explain why in the pull request.
To compare before and after:
go test -run '^$' -bench . -count 10 > new.txtand compare with the same run on master, for example with golang.org/x/perf/cmd/benchstat.
cd website
npm ci
npm run dev- For a large change, open an issue first so we can agree on the approach.
- Branch from
master, keep the change focused, and add a test that fails without it.