Repository: go-kratos/kratos
Pull request #2473 (2022-10-24 18:44:45)

build(deps): bump github.com/hashicorp/consul/api from 1.14.0 to 1.15.3 in /contrib/registry/consul
Bumps [github.com/hashicorp/consul/api](https://github.com/hashicorp/consul) from 1.14.0 to 1.15.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/hashicorp/consul/blob/main/CHANGELOG.md">github.com/hashicorp/consul/api's changelog</a>.</em></p>
<blockquote>
<h2>1.13.3 (October 19, 2022)</h2>
<p>FEATURES:</p>
<ul>
<li>agent: Added a new config option <code>rpc_client_timeout</code> to tune timeouts for client RPC requests [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14965">GH-14965</a>]</li>
<li>config-entry(ingress-gateway): Added support for <code>max_connections</code> for upstream clusters [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14749">GH-14749</a>]</li>
</ul>
<p>IMPROVEMENTS:</p>
<ul>
<li>connect/ca: Log a warning message instead of erroring when attempting to update the intermediate pki mount when using the Vault provider. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15035">GH-15035</a>]</li>
<li>connect: Added gateway options to Envoy proxy config for enabling tcp keepalives on terminating gateway upstreams and mesh gateways in remote datacenters. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14800">GH-14800</a>]</li>
<li>connect: Bump Envoy 1.20 to 1.20.7, 1.21 to 1.21.5 and 1.22 to 1.22.5 [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14828">GH-14828</a>]</li>
<li>licensing: <strong>(Enterprise Only)</strong> Consul Enterprise production licenses do not degrade or terminate Consul upon expiration. They will only fail when trying to upgrade to a newer version of Consul. Evaluation licenses still terminate. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/1990">GH-1990</a>]</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>agent: avoid leaking the alias check runner goroutine when the check is de-registered [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14935">GH-14935</a>]</li>
<li>ca: fix a masked bug in leaf cert generation that would not be notified of root cert rotation after the first one [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15005">GH-15005</a>]</li>
<li>cache: prevent goroutine leak in agent cache [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14908">GH-14908</a>]</li>
<li>checks: Fixed a bug that prevented registration of UDP health checks from agent configuration files, such as service definition files with embedded health check definitions. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14885">GH-14885</a>]</li>
<li>connect: Fixed a bug where transparent proxy does not correctly spawn listeners for upstreams to service-resolvers. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14751">GH-14751</a>]</li>
<li>snapshot-agent: <strong>(Enterprise only)</strong> Fix a bug when a session is not found in Consul, which leads the agent to panic.</li>
</ul>
<h2>1.12.6 (October 19, 2022)</h2>
<p>FEATURES:</p>
<ul>
<li>agent: Added a new config option <code>rpc_client_timeout</code> to tune timeouts for client RPC requests [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14965">GH-14965</a>]</li>
<li>agent: Added information about build date alongside other version information for Consul. Extended /agent/self endpoint and <code>consul version</code> commands
to report this. Agent also reports build date in log on startup. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/13357">GH-13357</a>]</li>
<li>config-entry(ingress-gateway): Added support for <code>max_connections</code> for upstream clusters [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14749">GH-14749</a>]</li>
</ul>
<p>IMPROVEMENTS:</p>
<ul>
<li>connect/ca: Log a warning message instead of erroring when attempting to update the intermediate pki mount when using the Vault provider. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15035">GH-15035</a>]</li>
<li>connect: Added gateway options to Envoy proxy config for enabling tcp keepalives on terminating gateway upstreams and mesh gateways in remote datacenters. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14800">GH-14800</a>]</li>
<li>connect: Bump Envoy 1.20 to 1.20.7, 1.21 to 1.21.5 and 1.22 to 1.22.5 [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14829">GH-14829</a>]</li>
<li>licensing: <strong>(Enterprise Only)</strong> Consul Enterprise production licenses do not degrade or terminate Consul upon expiration. They will only fail when trying to upgrade to a newer version of Consul. Evaluation licenses still terminate. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/1990">GH-1990</a>]</li>
</ul>
<p>BUG FIXES:</p>
<ul>
<li>agent: avoid leaking the alias check runner goroutine when the check is de-registered [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14935">GH-14935</a>]</li>
<li>ca: fix a masked bug in leaf cert generation that would not be notified of root cert rotation after the first one [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15005">GH-15005</a>]</li>
<li>cache: prevent goroutine leak in agent cache [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14908">GH-14908</a>]</li>
<li>connect: Fixed a bug where transparent proxy does not correctly spawn listeners for upstreams to service-resolvers. [<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14751">GH-14751</a>]</li>
<li>snapshot-agent: <strong>(Enterprise only)</strong> Fix a bug when a session is not found in Consul, which leads the agent to panic.</li>
</ul>
<h2>1.11.11 (October 19, 2022)</h2>
<p>FEATURES:</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/hashicorp/consul/commit/19a8c3734adb79a1839cfd1760e13b812bdaa49b"><code>19a8c37</code></a> Uncomment api go.mod replace.</li>
<li><a href="https://github.com/hashicorp/consul/commit/b29e5894f2322c9294b1f03c9b264ae2e6ae0eb0"><code>b29e589</code></a> Stage 1.13.3</li>
<li><a href="https://github.com/hashicorp/consul/commit/b8e43784c9cd96679e1a59443c19b169d904db14"><code>b8e4378</code></a> backport of commit a548634862b3ec7a0e6aa4b4ad4b271056351158 (<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15058">#15058</a>)</li>
<li><a href="https://github.com/hashicorp/consul/commit/9de04ef8d7493e68db56ab06542b187b1172ef4a"><code>9de04ef</code></a> backport of commit d122108992b6facf4ad02931772c09e96ab53237 (<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15049">#15049</a>)</li>
<li><a href="https://github.com/hashicorp/consul/commit/d4a20c272555405a7e71cab3b67e65633999a25c"><code>d4a20c2</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15040">#15040</a> from hashicorp/backport/kisunji/NET-1092/evenly-das...</li>
<li><a href="https://github.com/hashicorp/consul/commit/8e729690629ec79db3cbf7629c00fc80252e78ff"><code>8e72969</code></a> Fix imports</li>
<li><a href="https://github.com/hashicorp/consul/commit/ddf010deaa60154d29ca7c9857eaf7fbd7e697d1"><code>ddf010d</code></a> Remove unused methods from template</li>
<li><a href="https://github.com/hashicorp/consul/commit/262760a71dcc30118f6b9c0c1c4c661259e57a57"><code>262760a</code></a> Refactor client RPC timeouts (<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/14965">#14965</a>)</li>
<li><a href="https://github.com/hashicorp/consul/commit/9206f8940ee5cf74651a4ed9eb5917051a37a353"><code>9206f89</code></a> Backport of test: possibly fix flaky TestEnvoy/case-ingress-gateway-multiple-...</li>
<li><a href="https://github.com/hashicorp/consul/commit/10f9d8edfd5d6bdcc8637f1772d8ee335957fbdc"><code>10f9d8e</code></a> backport of commit 52957fcb179026c5fa82f84076fe4f5a6d5c4287 (<a href="https://github-redirect.dependabot.com/hashicorp/consul/issues/15031">#15031</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/hashicorp/consul/compare/api/v1.14.0...api/v1.15.3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/hashicorp/consul/api&package-manager=go_modules&previous-version=1.14.0&new-version=1.15.3)](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/contrib/config/apollo/README.md b/contrib/config/apollo/README.md
index c03cff0f..a8eea493 100644
--- a/contrib/config/apollo/README.md
+++ b/contrib/config/apollo/README.md
@@ -97,5 +97,4 @@ config := map[string]interface{}{
         }
     }
 }
-_ = config
 ```
diff --git a/contrib/config/apollo/apollo.go b/contrib/config/apollo/apollo.go
index 259ed1a9..bd96ef11 100644
--- a/contrib/config/apollo/apollo.go
+++ b/contrib/config/apollo/apollo.go
@@ -3,15 +3,14 @@ package apollo
 import (
 	"strings"
 
-	"github.com/go-kratos/kratos/v2/config"
-	"github.com/go-kratos/kratos/v2/log"
-
 	"github.com/apolloconfig/agollo/v4"
 	"github.com/apolloconfig/agollo/v4/constant"
 	apolloConfig "github.com/apolloconfig/agollo/v4/env/config"
 	"github.com/apolloconfig/agollo/v4/extension"
 
+	"github.com/go-kratos/kratos/v2/config"
 	"github.com/go-kratos/kratos/v2/encoding"
+	"github.com/go-kratos/kratos/v2/log"
 )
 
 type apollo struct {
diff --git a/contrib/config/apollo/watcher.go b/contrib/config/apollo/watcher.go
index 94ef2ef0..ea5ef108 100644
--- a/contrib/config/apollo/watcher.go
+++ b/contrib/config/apollo/watcher.go
@@ -4,12 +4,11 @@ import (
 	"context"
 	"strings"
 
-	"github.com/go-kratos/kratos/v2/encoding"
+	"github.com/apolloconfig/agollo/v4/storage"
 
 	"github.com/go-kratos/kratos/v2/config"
+	"github.com/go-kratos/kratos/v2/encoding"
 	"github.com/go-kratos/kratos/v2/log"
-
-	"github.com/apolloconfig/agollo/v4/storage"
 )
 
 type watcher struct {
diff --git a/contrib/config/consul/README.md b/contrib/config/consul/README.md
index a3d39a18..9dc5a066 100644
--- a/contrib/config/consul/README.md
+++ b/contrib/config/consul/README.md
@@ -2,20 +2,21 @@
 
 ```go
 import (
-    "github.com/go-kratos/kratos/contrib/config/consul/v2"
     "github.com/hashicorp/consul/api"
+
+    "github.com/go-kratos/kratos/contrib/config/consul/v2"
 )
-func main() {
 
+func main() {
     consulClient, err := api.NewClient(&api.Config{
-    Address: "127.0.0.1:8500",
+        Address: "127.0.0.1:8500",
     })
     if err != nil {
         panic(err)
     }
     cs, err := consul.New(consulClient, consul.WithPath("app/cart/configs/"))
-    //consul中需要标注文件后缀，kratos读取配置需要适配文件后缀
-    //The file suffix needs to be marked, and kratos needs to adapt the file suffix to read the configuration.
+    // consul中需要标注文件后缀，kratos读取配置需要适配文件后缀
+    // The file suffix needs to be marked, and kratos needs to adapt the file suffix to read the configuration.
     if err != nil {
         panic(err)
     }
diff --git a/contrib/config/etcd/README.md b/contrib/config/etcd/README.md
index d69edd82..131619c1 100644
--- a/contrib/config/etcd/README.md
+++ b/contrib/config/etcd/README.md
@@ -4,10 +4,11 @@
 import (
 	"log"
 
-	cfg "github.com/go-kratos/kratos/contrib/config/etcd/v2"
-	"github.com/go-kratos/kratos/v2/config"
 	clientv3 "go.etcd.io/etcd/client/v3"
 	"google.golang.org/grpc"
+
+	cfg "github.com/go-kratos/kratos/contrib/config/etcd/v2"
+	"github.com/go-kratos/kratos/v2/config"
 )
 
 // create an etcd client
diff --git a/contrib/config/nacos/README.md b/contrib/config/nacos/README.md
index 71f186bf..fa54caf0 100644
--- a/contrib/config/nacos/README.md
+++ b/contrib/config/nacos/README.md
@@ -2,9 +2,10 @@
 
 ```go
 import (
-	kconfig "github.com/go-kratos/kratos/v2/config"
 	"github.com/nacos-group/nacos-sdk-go/clients"
 	"github.com/nacos-group/nacos-sdk-go/common/constant"
+
+	kconfig "github.com/go-kratos/kratos/v2/config"
 )
 
 
diff --git a/contrib/config/nacos/go.mod b/contrib/config/nacos/go.mod
index 7890e058..6917f24a 100644
--- a/contrib/config/nacos/go.mod
+++ b/contrib/config/nacos/go.mod
@@ -5,6 +5,9 @@ go 1.16
 require (
 	github.com/go-kratos/kratos/v2 v2.4.0
 	github.com/nacos-group/nacos-sdk-go v1.0.9
+)
+
+require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 )
 
diff --git a/contrib/config/polaris/README.md b/contrib/config/polaris/README.md
index 4c2694c4..b39e78f2 100644
--- a/contrib/config/polaris/README.md
+++ b/contrib/config/polaris/README.md
@@ -2,24 +2,23 @@
 
 ```go
 import (
- "log"
-
- "github.com/polarismesh/polaris-go"
- "github.com/go-kratos/kratos/contrib/config/polaris/v2"
+	"log"
+	
+	"github.com/polarismesh/polaris-go"
+	
+	"github.com/go-kratos/kratos/contrib/config/polaris/v2"
 )
 
 func main() {
+    configApi, err := polaris.NewConfigAPI()
+    if err != nil {
+    	log.Fatalln(err)
+    }
 
- configApi, err := polaris.NewConfigAPI()
- if err != nil {
-  log.Fatalln(err)
- }
-
- source, err := New(&configApi, WithNamespace("default"), WithFileGroup("default"), WithFileName("default.yaml"))
-
- if err != nil {
-  log.Fatalln(err)
- }
- source.Load()
+    source, err := New(&configApi, WithNamespace("default"), WithFileGroup("default"), WithFileName("default.yaml"))
+    if err != nil {
+    	log.Fatalln(err)
+    }
+    source.Load()
 }
 ```
diff --git a/contrib/config/polaris/config.go b/contrib/config/polaris/config.go
index c3c39ece..288db438 100644
--- a/contrib/config/polaris/config.go
+++ b/contrib/config/polaris/config.go
@@ -6,9 +6,9 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/go-kratos/kratos/v2/config"
-
 	"github.com/polarismesh/polaris-go"
+
+	"github.com/go-kratos/kratos/v2/config"
 )
 
 // Option is polaris config option.
diff --git a/contrib/config/polaris/watcher.go b/contrib/config/polaris/watcher.go
index dcd89055..70305550 100644
--- a/contrib/config/polaris/watcher.go
+++ b/contrib/config/polaris/watcher.go
@@ -5,11 +5,11 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/go-kratos/kratos/v2/config"
-	"github.com/go-kratos/kratos/v2/log"
-
 	"github.com/polarismesh/polaris-go"
 	"github.com/polarismesh/polaris-go/pkg/model"
+
+	"github.com/go-kratos/kratos/v2/config"
+	"github.com/go-kratos/kratos/v2/log"
 )
 
 type Watcher struct {
@@ -28,7 +28,7 @@ func getFullPath(namespace string, fileGroup string, fileName string) string {
 	return fmt.Sprintf("%s/%s/%s", namespace, fileGroup, fileName)
 }
 
-func recieve(event model.ConfigFileChangeEvent) {
+func receive(event model.ConfigFileChangeEvent) {
 	meta := event.ConfigFileMetadata
 	ec := eventChanMap[getFullPath(meta.GetNamespace(), meta.GetFileGroup(), meta.GetFileName())]
 	defer func() {
@@ -42,7 +42,7 @@ func recieve(event model.ConfigFileChangeEvent) {
 }
 
 func newWatcher(configFile polaris.ConfigFile) *Watcher {
-	configFile.AddChangeListener(recieve)
+	configFile.AddChangeListener(receive)
 
 	fullPath := getFullPath(configFile.GetNamespace(), configFile.GetFileGroup(), configFile.GetFileName())
 	if _, ok := eventChanMap[fullPath]; !ok {
diff --git a/contrib/log/aliyun/go.mod b/contrib/log/aliyun/go.mod
index 83029a5d..1c7b5fa8 100644
--- a/contrib/log/aliyun/go.mod
+++ b/contrib/log/aliyun/go.mod
@@ -3,7 +3,7 @@ module github.com/go-kratos/kratos/contrib/log/aliyun/v2
 go 1.16
 
 require (
-	github.com/aliyun/aliyun-log-go-sdk v0.1.37
+	github.com/aliyun/aliyun-log-go-sdk v0.1.39
 	github.com/go-kratos/kratos/v2 v2.5.2
 	google.golang.org/protobuf v1.28.1
 )
diff --git a/contrib/log/aliyun/go.sum b/contrib/log/aliyun/go.sum
index 6fde6344..ab2ac488 100644
--- a/contrib/log/aliyun/go.sum
+++ b/contrib/log/aliyun/go.sum
@@ -12,8 +12,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
 github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
 github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/aliyun/aliyun-log-go-sdk v0.1.37 h1:GvswbgLqVOHNeMWssQ9zA+R7YVDP6arLUP92bKyGZNw=
-github.com/aliyun/aliyun-log-go-sdk v0.1.37/go.mod h1:1QQ59pEJiVVXqKgbHcU6FWIgxT5RKBt+CT8AiQ2bEts=
+github.com/aliyun/aliyun-log-go-sdk v0.1.39 h1:oVLVcRbtOhE4a1D4HhO3OYPR6wMADl3ldcbVeFrRL8Y=
+github.com/aliyun/aliyun-log-go-sdk v0.1.39/go.mod h1:1QQ59pEJiVVXqKgbHcU6FWIgxT5RKBt+CT8AiQ2bEts=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
diff --git a/contrib/registry/consul/go.mod b/contrib/registry/consul/go.mod
index db17f9cc..c94149ce 100644
--- a/contrib/registry/consul/go.mod
+++ b/contrib/registry/consul/go.mod
@@ -4,7 +4,7 @@ go 1.16
 
 require (
 	github.com/go-kratos/kratos/v2 v2.5.2
-	github.com/hashicorp/consul/api v1.14.0
+	github.com/hashicorp/consul/api v1.15.3
 )
 
 replace github.com/go-kratos/kratos/v2 => ../../../
diff --git a/contrib/registry/consul/go.sum b/contrib/registry/consul/go.sum
index 41a5b15b..b1d94b2a 100644
--- a/contrib/registry/consul/go.sum
+++ b/contrib/registry/consul/go.sum
@@ -91,10 +91,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
 github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
-github.com/hashicorp/consul/api v1.14.0 h1:Y64GIJ8hYTu+tuGekwO4G4ardXoiCivX9wv1iP/kihk=
-github.com/hashicorp/consul/api v1.14.0/go.mod h1:bcaw5CSZ7NE9qfOfKCI1xb7ZKjzu/MyvQkCLTfqLqxQ=
-github.com/hashicorp/consul/sdk v0.10.0 h1:rGLEh2AWK4K0KCMvqWAz2EYxQqgciIfMagWZ0nVe5MI=
-github.com/hashicorp/consul/sdk v0.10.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw=
+github.com/hashicorp/consul/api v1.15.3 h1:WYONYL2rxTXtlekAqblR2SCdJsizMDIj/uXb5wNy9zU=
+github.com/hashicorp/consul/api v1.15.3/go.mod h1:/g/qgcoBcEXALCNZgRRisyTW0nY86++L0KbeAMXYCeY=
+github.com/hashicorp/consul/sdk v0.11.0 h1:HRzj8YSCln2yGgCumN5CL8lYlD3gBurnervJRJAZyC4=
+github.com/hashicorp/consul/sdk v0.11.0/go.mod h1:yPkX5Q6CsxTFMjQQDJwzeNmUUF5NUGGbrDsv9wTb8cw=
 github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
 github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
 github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
diff --git a/selector/node/ewma/node.go b/selector/node/ewma/node.go
index 46d5c41c..3b8d2a02 100644
--- a/selector/node/ewma/node.go
+++ b/selector/node/ewma/node.go
@@ -161,7 +161,7 @@ func (n *Node) Pick() selector.DoneFunc {
 			}
 			var netErr net.Error
 			if errors.Is(context.DeadlineExceeded, di.Err) || errors.Is(context.Canceled, di.Err) ||
-				errors.IsServiceUnavailable(di.Err) || errors.IsGatewayTimeout(di.Err) || errors.As(di.Err, netErr) {
+				errors.IsServiceUnavailable(di.Err) || errors.IsGatewayTimeout(di.Err) || errors.As(di.Err, &netErr) {
 				success = 0
 			}
 		}


Test patch:
diff --git a/contrib/config/kubernetes/config_test.go b/contrib/config/kubernetes/config_test.go
index 6cdb1c98..b110b634 100644
--- a/contrib/config/kubernetes/config_test.go
+++ b/contrib/config/kubernetes/config_test.go
@@ -8,14 +8,14 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/go-kratos/kratos/v2/config"
-
 	v1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/client-go/kubernetes"
 	"k8s.io/client-go/rest"
 	"k8s.io/client-go/tools/clientcmd"
 	"k8s.io/client-go/util/homedir"
+
+	"github.com/go-kratos/kratos/v2/config"
 )
 
 const (
diff --git a/selector/node/ewma/node_test.go b/selector/node/ewma/node_test.go
index feac09f2..d930495c 100644
--- a/selector/node/ewma/node_test.go
+++ b/selector/node/ewma/node_test.go
@@ -2,6 +2,7 @@ package ewma
 
 import (
 	"context"
+	"net"
 	"reflect"
 	"testing"
 	"time"
@@ -100,11 +101,15 @@ func TestDirectErrorHandler(t *testing.T) {
 			Endpoints: []string{"http://127.0.0.1:9090"},
 			Metadata:  map[string]string{"weight": "10"},
 		}))
-
+	errs := []error{
+		context.DeadlineExceeded,
+		context.Canceled,
+		net.ErrClosed,
+	}
 	for i := 0; i < 5; i++ {
 		var err error
 		if i != 0 {
-			err = context.DeadlineExceeded
+			err = errs[i%len(errs)]
 		}
 		done := wn.Pick()
 		if done == nil {