Repository: zeromicro/go-zero
Pull request #2260 (2022-08-12 19:45:14)

chore(deps): bump github.com/alicebob/miniredis/v2 from 2.22.0 to 2.23.0
Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.22.0 to 2.23.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/alicebob/miniredis/releases">github.com/alicebob/miniredis/v2's releases</a>.</em></p>
<blockquote>
<h2>INFO, LPOS, XPENDING</h2>
<ul>
<li>basic INFO support (thanks <a href="https://github.com/kirill-a-belov"><code>@​kirill-a-belov</code></a>)</li>
<li>support COUNT in SSCAN (thanks <a href="https://github.com/Abdi-dd"><code>@​Abdi-dd</code></a>)</li>
<li>test and support Go 1.19</li>
<li>support LPOS (thanks <a href="https://github.com/ianstarz"><code>@​ianstarz</code></a>)</li>
<li>support XPENDING, XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, XCLAIM (thanks <a href="https://github.com/sandyharvie"><code>@​sandyharvie</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md">github.com/alicebob/miniredis/v2's changelog</a>.</em></p>
<blockquote>
<h3>v2.23.0</h3>
<ul>
<li>basic INFO support (thanks <a href="https://github.com/kirill-a-belov"><code>@​kirill-a-belov</code></a>)</li>
<li>support COUNT in SSCAN (thanks <a href="https://github.com/Abdi-dd"><code>@​Abdi-dd</code></a>)</li>
<li>test and support Go 1.19</li>
<li>support LPOS (thanks <a href="https://github.com/ianstarz"><code>@​ianstarz</code></a>)</li>
<li>support XPENDING, XGROUP {CREATECONSUMER,DESTROY,DELCONSUMER}, XINFO {CONSUMERS,GROUPS}, XCLAIM (thanks <a href="https://github.com/sandyharvie"><code>@​sandyharvie</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/alicebob/miniredis/commit/12c3ec2e114159bb35134d421ba49a64846087bf"><code>12c3ec2</code></a> update changelog for v2.23.0</li>
<li><a href="https://github.com/alicebob/miniredis/commit/82d7bcc0288cee167c6f74be997129608d127c86"><code>82d7bcc</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/alicebob/miniredis/issues/281">#281</a> from sandyharvie/add-support-for-additional-stream-co...</li>
<li><a href="https://github.com/alicebob/miniredis/commit/41c1bec10cfefd07e30d8f2b1fc0b7aeb4803dcd"><code>41c1bec</code></a> extend <code>XPENDING</code> and add support for `XGROUP {CREATECONSUMER,DESTROY,DELCONS...</li>
<li><a href="https://github.com/alicebob/miniredis/commit/1086c8cf002da40b0ee99d7f3e2f09ab3cf457d7"><code>1086c8c</code></a> skip unstable test</li>
<li><a href="https://github.com/alicebob/miniredis/commit/d437a8e3dc5ab83b9d1ff58ee24922753b0b71c9"><code>d437a8e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/alicebob/miniredis/issues/287">#287</a> from Abdi-dd/master</li>
<li><a href="https://github.com/alicebob/miniredis/commit/9fc7af89c7f4b8d05b8148cd4c3835b0fa29d8d6"><code>9fc7af8</code></a> some int tests</li>
<li><a href="https://github.com/alicebob/miniredis/commit/b2b937335ed18a2615f81eda7eb4bc524290b59d"><code>b2b9373</code></a> Merge branch 'master' into HEAD</li>
<li><a href="https://github.com/alicebob/miniredis/commit/e4a93abf0465cad288da8c283cfab6662ff74e1d"><code>e4a93ab</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/alicebob/miniredis/issues/286">#286</a> from ianstarz/lpos</li>
<li><a href="https://github.com/alicebob/miniredis/commit/f75e5111c29ac356f77d05609a69ce169cbae136"><code>f75e511</code></a> Implement LPOS</li>
<li><a href="https://github.com/alicebob/miniredis/commit/5bda2969aac93d31326ceb462cae1fae9222d8a2"><code>5bda296</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/alicebob/miniredis/issues/284">#284</a> from alicebob/gofmt</li>
<li>Additional commits viewable in <a href="https://github.com/alicebob/miniredis/compare/v2.22.0...v2.23.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/alicebob/miniredis/v2&package-manager=go_modules&previous-version=2.22.0&new-version=2.23.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index 016f3f70..7612bcfb 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.16
 require (
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
 	github.com/DATA-DOG/go-sqlmock v1.5.0
-	github.com/alicebob/miniredis/v2 v2.22.0
+	github.com/alicebob/miniredis/v2 v2.23.0
 	github.com/fatih/color v1.13.0
 	github.com/fullstorydev/grpcurl v1.8.7
 	github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
diff --git a/go.sum b/go.sum
index f85dc99c..df2178d0 100644
--- a/go.sum
+++ b/go.sum
@@ -59,8 +59,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
 github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
-github.com/alicebob/miniredis/v2 v2.22.0 h1:lIHHiSkEyS1MkKHCHzN+0mWrA4YdbGdimE5iZ2sHSzo=
-github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
+github.com/alicebob/miniredis/v2 v2.23.0 h1:+lwAJYjvvdIVg6doFHuotFjueJ/7KY10xo/vm3X3Scw=
+github.com/alicebob/miniredis/v2 v2.23.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=


Test patch:
diff --git a/rest/httpc/responses_test.go b/rest/httpc/responses_test.go
index b273325e..6f1a2d1e 100644
--- a/rest/httpc/responses_test.go
+++ b/rest/httpc/responses_test.go
@@ -63,3 +63,23 @@ func TestParseNoBody(t *testing.T) {
 	assert.Nil(t, Parse(resp, &val))
 	assert.Equal(t, "bar", val.Foo)
 }
+
+func TestParseWithZeroValue(t *testing.T) {
+	var val struct {
+		Foo int `header:"foo"`
+		Bar int `json:"bar"`
+	}
+	svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.Header().Set("foo", "0")
+		w.Header().Set(header.ContentType, header.JsonContentType)
+		w.Write([]byte(`{"bar":0}`))
+	}))
+	defer svr.Close()
+	req, err := http.NewRequest(http.MethodGet, svr.URL, nil)
+	assert.Nil(t, err)
+	resp, err := DoRequest(req)
+	assert.Nil(t, err)
+	assert.Nil(t, Parse(resp, &val))
+	assert.Equal(t, 0, val.Foo)
+	assert.Equal(t, 0, val.Bar)
+}