On this page

Go SDK 9.0.0 Migration Guide

This guide summarizes the differences between versions 8.x.x and 9.0.0 and shows how to migrate to Go SDK 9.0.0.

Go SDK version 9.0.0 raises the minimum supported Go version to 1.25 and updates the module path accordingly. There are no changes to the public API surface.

No Go SDK 8.x.x support

If your application uses Go SDK 8.x.x, it continues to work. We recommend migrating to Go 9.0.0 to access ongoing improvements. Version 8.x.x receives only critical security fixes.

What has changed

See the major differences between versions:

Feature/AreaGo SDK 8.x.xGo SDK 9.0.0
Minimum Go version
1.18
1.25
Module path
github.com/pubnub/go/v8
github.com/pubnub/go/v9
Public API
No changes

Breaking changes

Minimum Go version

Go SDK 9.0.0 requires Go 1.25 or later. If your project currently targets an earlier version, you must upgrade your Go toolchain before updating the SDK.

Go 1.25 required

Attempting to build with an older Go toolchain against github.com/pubnub/go/v9 will produce a build error. Run go version to confirm the toolchain version before upgrading.

module your-app

go 1.18

require github.com/pubnub/go/v8 v8.2.0

Module path

The module path has changed from github.com/pubnub/go/v8 to github.com/pubnub/go/v9. All import statements and go.mod entries must be updated.

import (
pubnub "github.com/pubnub/go/v8"
)

Migration steps

To migrate from Go SDK 8.x.x to 9.0.0:

  1. Upgrade your Go toolchain to version 1.25 or later. Download it from go.dev/dl.

  2. Update the dependency:

    go get github.com/pubnub/go/v9
  3. Update all import statements across your codebase. You can do this with a global find-and-replace:

    FindReplace
    github.com/pubnub/go/v8
    github.com/pubnub/go/v9

    Or use go itself to rewrite all imports at once — this works on both macOS and Linux:

    go install golang.org/x/tools/cmd/goimports@latest
    find . -type f -name '*.go' | xargs goimports -w

    Alternatively, run a plain sed replacement. The syntax differs by platform:

    # macOS
    find . -type f -name '*.go' -exec sed -i '' 's|github.com/pubnub/go/v8|github.com/pubnub/go/v9|g' {} +

    # Linux
    find . -type f -name '*.go' -exec sed -i 's|github.com/pubnub/go/v8|github.com/pubnub/go/v9|g' {} +
  4. Tidy your module to remove the old dependency:

    go mod tidy
  5. Build and test your application to confirm the upgrade is complete:

    go build ./...
    go test ./...

Additional resources

For API details, see the Go SDK documentation. For questions or issues, contact PubNub support.