Contributing

August 28, 2025 ยท View on GitHub

Installing the go development environment

  1. Install homebrew

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    
  2. Install go

    brew install go --cross-compile-all
    
  3. Configure $GOPATH in ~/.bashrc

    export GOPATH="$HOME/go"
    export PATH=$PATH:$GOPATH/bin
    

Downloading the code

You can download the code and its dependencies using

go get -t github.com/bugsnag/bugsnag-go/v2

It will be put into "$GOPATH/src/github.com/bugsnag/bugsnag-go"

Then install depend

Running Tests

You can run the tests with

go test ./...

Making PRs

All PRs should target the next branch as their base. This means that we can land them and stage them for a release without making multiple changes to master (which would cause multiple releases due to go get's behaviour).

The exception to this rule is for an urgent bug fix when next is already ahead of master. See hotfixes for what to do then.

Releasing a New Version

If you are a project maintainer, you can build and release a new version of bugsnag-go as follows:

Planned releases

Prerequisite: All code changes should already have been reviewed and PR'd into the next branch before making a release.

  1. Decide on a version number and date for this release
  2. Add an entry (or update the TBD entry if it exists) for this release in CHANGELOG.md so that it includes the version number, release date and granular description of what changed
  3. Update the version number in v2/bugsnag.go and verify that tests pass.
  4. Create a PR from release-x.x.x-next -> next titled Release vX.X.X, adding a description to help the reviewer understand the scope of the release
  5. Create a PR from next to master on GitHub, set the commit message to vX.X.X
  6. Create a release from current master on GitHub called vX.X.X. Copy and paste the markdown from this release's notes in CHANGELOG.md (this will create a git tag for you).

Hotfixes

If a next branch already exists and is ahead of master but there is a bug fix which needs to go out urgently, check out the latest master and create a new hotfix branch git checkout -b hotfix. You can then proceed to follow the above steps, substituting next for hotfix.

Once released, ensure master is merged into next so that the changes made on hotfix are included.