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/Area | Go SDK 8.x.x | Go 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.
- Before (v8.x.x)
- After (v9.x.x)
module your-app
go 1.18
require github.com/pubnub/go/v8 v8.2.0
module your-app
go 1.25
require github.com/pubnub/go/v9 v9.0.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.
- Before (v8.x.x)
- After (v9.x.x)
import (
pubnub "github.com/pubnub/go/v8"
)
import (
pubnub "github.com/pubnub/go/v9"
)
Migration steps
To migrate from Go SDK 8.x.x to 9.0.0:
-
Upgrade your Go toolchain to version 1.25 or later. Download it from go.dev/dl.
-
Update the dependency:
go get github.com/pubnub/go/v9 -
Update all import statements across your codebase. You can do this with a global find-and-replace:
Find Replace github.com/pubnub/go/v8github.com/pubnub/go/v9Or use
goitself 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 -wAlternatively, run a plain
sedreplacement. 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' {} + -
Tidy your module to remove the old dependency:
go mod tidy -
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.