Dial()
is replaced byDialContext()
- 🔄Update:
-cli, err := mqtt.Dial(url) +cli, err := mqtt.DialContext(ctx, url) if err != nil { // error handling } if _, err := cli.Connect(ctx, ...); err != nil { // error handling }
- 🔄If
mqtt.DialerFunc
is used, update:-mqtt.DialerFunc(func() (*mqtt.BaseClient, error) { +mqtt.DialerFunc(func(ctx context.Context) (*mqtt.BaseClient, error) {
- 🔄If you want to use
mqtt.Dialer
interface of mqtt-go<1.14, wrap dialer by:&mqtt.NoContextDialer{oldDialer}
- 🔄Update:
Dial()
returns*BaseClient
instead ofClientCloser
- 🔄Update variable type if needed.
- Second argument of
RetryClient.SetClient()
requires*BaseClient
instead ofClientCloser
- 🔄Store client passed to
SetClient
as*BaseClient
or convert it by the type assertion likecli.(*BaseClient)
.
- 🔄Store client passed to
Client.Subscribe()
returns resultant subscription information as a first return value- 🔄Update:
-err := cli.Subscribe(...) +_, err := cli.Subscribe(...)
- 🔄Update: