Repository: seqsense/aws-iot-device-sdk-go
Pull request #209 (2021-02-16 02:43:20)

Update at-wat/mqtt-go to v0.12.0
Details of the API changes: https://github.com/at-wat/mqtt-go/releases/tag/v0.12.0

codecov[bot]: # [Codecov](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=h1) Report
> Merging [#209](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=desc) (1ba94ba) into [master](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/commit/786f4a10941a79028704b681db333545a7426082?el=desc) (786f4a1) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209/graphs/tree.svg?width=650&height=150&src=pr&token=St5U6jzMqv)](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #209   +/-   ##
=======================================
  Coverage   58.19%   58.19%           
=======================================
  Files          27       27           
  Lines        1239     1239           
=======================================
  Hits          721      721           
  Misses        461      461           
  Partials       57       57           
```


| [Impacted Files](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [dialer.go](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209/diff?src=pr&el=tree#diff-ZGlhbGVyLmdv) | `90.90% <ø> (ø)` | |
| [jobs/jobs.go](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209/diff?src=pr&el=tree#diff-am9icy9qb2JzLmdv) | `86.70% <100.00%> (ø)` | |
| [shadow/shadow.go](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209/diff?src=pr&el=tree#diff-c2hhZG93L3NoYWRvdy5nbw==) | `81.43% <100.00%> (ø)` | |
| [tunnel/tunnel.go](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209/diff?src=pr&el=tree#diff-dHVubmVsL3R1bm5lbC5nbw==) | `76.19% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=footer). Last update [786f4a1...57ece21](https://codecov.io/gh/seqsense/aws-iot-device-sdk-go/pull/209?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

at-wat: @kamatama41 @t-asaka please take a look

Patch:
diff --git a/dialer.go b/dialer.go
index d8e1a2c..09a1dc9 100644
--- a/dialer.go
+++ b/dialer.go
@@ -40,7 +40,7 @@ func NewPresignDialer(sess client.ConfigProvider, endpoint string, opts ...mqtt.
 	}, nil
 }
 
-func (d *presignDialer) Dial() (mqtt.ClientCloser, error) {
+func (d *presignDialer) Dial() (*mqtt.BaseClient, error) {
 	url, err := d.signer.PresignWssNow(d.endpoint)
 	if err != nil {
 		return nil, ioterr.New(err, "presigning wss URL")
diff --git a/go.mod b/go.mod
index 58b7326..302bcad 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
 module github.com/seqsense/aws-iot-device-sdk-go/v4
 
 require (
-	github.com/at-wat/mqtt-go v0.11.4
+	github.com/at-wat/mqtt-go v0.12.0
 	github.com/aws/aws-sdk-go v1.37.6
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/golang/protobuf v1.4.3
diff --git a/go.sum b/go.sum
index b79e4c4..0ce1117 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/at-wat/mqtt-go v0.11.4 h1:tVv+BhsT1SbbdZ9QuBPnPb4iVy7V6hYMenAatQ2z8xY=
-github.com/at-wat/mqtt-go v0.11.4/go.mod h1:NWhjSXyT2oraZmmgomhft0vSLL2DQNrSsRZmG1odl1s=
+github.com/at-wat/mqtt-go v0.12.0 h1:FMNOx7ERFt3N8kx/LxSSfGMk5BnlB5cwxjRqrYV6+7A=
+github.com/at-wat/mqtt-go v0.12.0/go.mod h1:b4QTk+HgoReGBw9R652AH0Kqc2OvkLSD7lOgyxWgeQE=
 github.com/aws/aws-sdk-go v1.37.6 h1:SWYjRvyZw6DJc3pkZfRWVRD/5wiTDuwOkyb89AAkEBY=
 github.com/aws/aws-sdk-go v1.37.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -54,8 +54,6 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
 golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw=
-golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew=
diff --git a/jobs/jobs.go b/jobs/jobs.go
index 5026d33..e78e25f 100644
--- a/jobs/jobs.go
+++ b/jobs/jobs.go
@@ -86,7 +86,7 @@ func New(ctx context.Context, cli awsiotdev.Device) (Jobs, error) {
 		}
 	}
 
-	err := cli.Subscribe(ctx,
+	_, err := cli.Subscribe(ctx,
 		mqtt.Subscription{Topic: j.topic("notify"), QoS: mqtt.QoS1},
 		mqtt.Subscription{Topic: j.topic("get/#"), QoS: mqtt.QoS1},
 		mqtt.Subscription{Topic: j.topic("+/get/#"), QoS: mqtt.QoS1},
diff --git a/shadow/shadow.go b/shadow/shadow.go
index 2004c6b..edecba0 100644
--- a/shadow/shadow.go
+++ b/shadow/shadow.go
@@ -203,7 +203,7 @@ func New(ctx context.Context, cli awsiotdev.Device, opt ...Option) (Shadow, erro
 		}
 	}
 
-	err := cli.Subscribe(ctx,
+	_, err := cli.Subscribe(ctx,
 		mqtt.Subscription{Topic: s.topic("update/delta"), QoS: mqtt.QoS1},
 		mqtt.Subscription{Topic: s.topic("update/accepted"), QoS: mqtt.QoS1},
 		mqtt.Subscription{Topic: s.topic("update/rejected"), QoS: mqtt.QoS1},
diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go
index 5872869..df6a4cb 100644
--- a/tunnel/tunnel.go
+++ b/tunnel/tunnel.go
@@ -79,7 +79,7 @@ func New(ctx context.Context, cli awsiotdev.Device, dialer map[string]Dialer, op
 		return nil, ioterr.New(err, "registering message handler")
 	}
 
-	err := cli.Subscribe(ctx,
+	_, err := cli.Subscribe(ctx,
 		mqtt.Subscription{Topic: t.opts.TopicFunc("notify"), QoS: mqtt.QoS1},
 	)
 	if err != nil {


Test patch:
diff --git a/awsiotdev_test.go b/awsiotdev_test.go
index 701b475..368afd5 100644
--- a/awsiotdev_test.go
+++ b/awsiotdev_test.go
@@ -22,7 +22,7 @@ import (
 
 func TestNew(t *testing.T) {
 	const name = "thing_name1"
-	d, err := New(name, mqtt.DialerFunc(func() (mqtt.ClientCloser, error) {
+	d, err := New(name, mqtt.DialerFunc(func() (*mqtt.BaseClient, error) {
 		return &mqtt.BaseClient{}, nil
 	}))
 	if err != nil {
diff --git a/jobs/jobs_test.go b/jobs/jobs_test.go
index 945ac38..b395c9e 100644
--- a/jobs/jobs_test.go
+++ b/jobs/jobs_test.go
@@ -46,8 +46,8 @@ func TestNew(t *testing.T) {
 		defer cancel()
 
 		cli := &mockDevice{&mockmqtt.Client{
-			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) error {
-				return errDummy
+			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) ([]mqtt.Subscription, error) {
+				return nil, errDummy
 			},
 		}}
 		_, err := New(ctx, cli)
diff --git a/shadow/shadow_test.go b/shadow/shadow_test.go
index c8a9a41..c53c84b 100644
--- a/shadow/shadow_test.go
+++ b/shadow/shadow_test.go
@@ -44,8 +44,8 @@ func TestNew(t *testing.T) {
 		defer cancel()
 
 		cli := &mockDevice{&mockmqtt.Client{
-			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) error {
-				return errDummy
+			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) ([]mqtt.Subscription, error) {
+				return nil, errDummy
 			},
 		}}
 		_, err := New(ctx, cli)
diff --git a/tunnel/tunnel_test.go b/tunnel/tunnel_test.go
index eaf71d9..109dba4 100644
--- a/tunnel/tunnel_test.go
+++ b/tunnel/tunnel_test.go
@@ -59,8 +59,8 @@ func TestNew(t *testing.T) {
 		defer cancel()
 
 		cli := &mockDevice{&mockmqtt.Client{
-			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) error {
-				return errDummy
+			SubscribeFn: func(ctx context.Context, subs ...mqtt.Subscription) ([]mqtt.Subscription, error) {
+				return nil, errDummy
 			},
 		}}
 		_, err := New(ctx, cli, map[string]Dialer{})