You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/06/11 15:49:40 UTC

[GitHub] [dubbo-go] gaoxinge opened a new pull request #601: Zk client

gaoxinge opened a new pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601


   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   
   - add lock for `eventRegistry` in `ZookeeperClient ` to avoid concurrent read and write map
   - replace `github.com/stretchr/testify/assert` with `github.com/stretchr/testify/require`  in test to fail test immediately
   - fix type and remove `\n` in log
   
   **Special notes for your reviewer**:
   
   - NONE
   
   **Does this PR introduce a user-facing change?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
   -->
   ```release-note
   NONE
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] gaoxinge commented on a change in pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
gaoxinge commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r440239055



##########
File path: remoting/zookeeper/client_test.go
##########
@@ -18,14 +18,17 @@
 package zookeeper
 
 import (
-	"fmt"
 	"testing"
 	"time"
 )
 
 import (
 	"github.com/dubbogo/go-zookeeper/zk"
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"

Review comment:
       ## an example
   
   ```go
   func TestSomething(t *testing.T) {
   	var err error
   
   	err = perrors.Errorf("something1")
   	assert.NoError(t, err)
   
   	err = perrors.Errorf("something2")
   	assert.NoError(t, err)
   }
   ```
   
   - use `testify/assert` will output two errors on console:
   
   ```
   === RUN   TestSomething
   --- FAIL: TestSomething (0.00s)
       client_test.go:151: 
           	Error Trace:	client_test.go:151
           	Error:      	Received unexpected error:
           	            	something1
           	            	github.com/apache/dubbo-go/remoting/zookeeper.TestSomething
           	            		D:/GoPath/src/github.com/apache/dubbo-go/remoting/zookeeper/client_test.go:150
           	            	testing.tRunner
           	            		D:/Go/src/testing/testing.go:909
           	            	runtime.goexit
           	            		D:/Go/src/runtime/asm_amd64.s:1357
           	Test:       	TestSomething
       client_test.go:154: 
           	Error Trace:	client_test.go:154
           	Error:      	Received unexpected error:
           	            	something2
           	            	github.com/apache/dubbo-go/remoting/zookeeper.TestSomething
           	            		D:/GoPath/src/github.com/apache/dubbo-go/remoting/zookeeper/client_test.go:153
           	            	testing.tRunner
           	            		D:/Go/src/testing/testing.go:909
           	            	runtime.goexit
           	            		D:/Go/src/runtime/asm_amd64.s:1357
           	Test:       	TestSomething
   FAIL
   ``` 
   
   - use `testify/require` just output the first error and stop the test case intermediately
   
   ## why I prefer `testify/require`
   
   - Because errors in test case may have some dependency: first error causes second error, then I think it's better to use `testify/require`, which only shows the first error.
   - Using `testify/assert` may output too many errors, but developers only need to focus on fixing the first error.  
   
   @AlexStocks 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#issuecomment-642780437


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=h1) Report
   > Merging [#601](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=desc) into [feature/dubbo-2.7.5](https://codecov.io/gh/apache/dubbo-go/commit/d997d51e8ad6636a871a8fb1027891fd029927ce&el=desc) will **decrease** coverage by `0.37%`.
   > The diff coverage is `72.91%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/601/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree)
   
   ```diff
   @@                   Coverage Diff                   @@
   ##           feature/dubbo-2.7.5     #601      +/-   ##
   =======================================================
   - Coverage                66.16%   65.78%   -0.38%     
   =======================================================
     Files                      204      204              
     Lines                    10610    10604       -6     
   =======================================================
   - Hits                      7020     6976      -44     
   - Misses                    2912     2951      +39     
   + Partials                   678      677       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `66.66% <72.91%> (-0.57%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `30.76% <0.00%> (-10.00%)` | :arrow_down: |
   | [protocol/dubbo/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vcG9vbC5nbw==) | `74.88% <0.00%> (-6.40%)` | :arrow_down: |
   | [protocol/dubbo/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vY2xpZW50Lmdv) | `64.24% <0.00%> (-4.85%)` | :arrow_down: |
   | [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `78.49% <0.00%> (-2.16%)` | :arrow_down: |
   | [protocol/dubbo/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vbGlzdGVuZXIuZ28=) | `56.45% <0.00%> (-1.08%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `57.00% <0.00%> (+0.93%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?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/apache/dubbo-go/pull/601?src=pr&el=footer). Last update [669301f...df758dc](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r441282019



##########
File path: remoting/zookeeper/client.go
##########
@@ -42,21 +42,23 @@ const (
 )
 
 var (
-	errNilZkClientConn = perrors.New("zookeeperclient{conn} is nil")
+	errNilZkClientConn = perrors.New("zookeeper client{conn} is nil")
 	errNilChildren     = perrors.Errorf("has none children")
 	errNilNode         = perrors.Errorf("node does not exist")
 )
 
 // ZookeeperClient ...

Review comment:
       maybe u can add some comments for this struct or just using "nolint" instead.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] gaoxinge commented on a change in pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
gaoxinge commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r440622197



##########
File path: remoting/zookeeper/client_test.go
##########
@@ -18,14 +18,17 @@
 package zookeeper
 
 import (
-	"fmt"
 	"testing"
 	"time"
 )
 
 import (
 	"github.com/dubbogo/go-zookeeper/zk"
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"

Review comment:
       @AlexStocks Ok, I revert `require` to `assert`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks merged pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] codecov-commenter commented on pull request #601: Zk client

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#issuecomment-642780437


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=h1) Report
   > Merging [#601](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=desc) into [feature/dubbo-2.7.5](https://codecov.io/gh/apache/dubbo-go/commit/d997d51e8ad6636a871a8fb1027891fd029927ce&el=desc) will **decrease** coverage by `0.26%`.
   > The diff coverage is `72.91%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/601/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree)
   
   ```diff
   @@                   Coverage Diff                   @@
   ##           feature/dubbo-2.7.5     #601      +/-   ##
   =======================================================
   - Coverage                66.16%   65.89%   -0.27%     
   =======================================================
     Files                      204      204              
     Lines                    10610    10604       -6     
   =======================================================
   - Hits                      7020     6988      -32     
   - Misses                    2912     2938      +26     
     Partials                   678      678              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `66.66% <72.91%> (-0.57%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `30.76% <0.00%> (-10.00%)` | :arrow_down: |
   | [protocol/dubbo/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vcG9vbC5nbw==) | `76.71% <0.00%> (-4.57%)` | :arrow_down: |
   | [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `78.49% <0.00%> (-2.16%)` | :arrow_down: |
   | [protocol/dubbo/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vY2xpZW50Lmdv) | `67.87% <0.00%> (-1.22%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `56.07% <0.00%> (ø)` | |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `79.24% <0.00%> (+0.94%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?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/apache/dubbo-go/pull/601?src=pr&el=footer). Last update [669301f...e6c92b9](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r440553941



##########
File path: remoting/zookeeper/client_test.go
##########
@@ -18,14 +18,17 @@
 package zookeeper
 
 import (
-	"fmt"
 	"testing"
 	"time"
 )
 
 import (
 	"github.com/dubbogo/go-zookeeper/zk"
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"

Review comment:
       However, it is impossible that we test the same error case in one Testxxx.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] codecov-commenter edited a comment on pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#issuecomment-642780437


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=h1) Report
   > Merging [#601](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=desc) into [feature/dubbo-2.7.5](https://codecov.io/gh/apache/dubbo-go/commit/d997d51e8ad6636a871a8fb1027891fd029927ce&el=desc) will **decrease** coverage by `0.26%`.
   > The diff coverage is `72.91%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/601/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree)
   
   ```diff
   @@                   Coverage Diff                   @@
   ##           feature/dubbo-2.7.5     #601      +/-   ##
   =======================================================
   - Coverage                66.16%   65.89%   -0.27%     
   =======================================================
     Files                      204      204              
     Lines                    10610    10604       -6     
   =======================================================
   - Hits                      7020     6988      -32     
   - Misses                    2912     2938      +26     
     Partials                   678      678              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `66.66% <72.91%> (-0.57%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `30.76% <0.00%> (-10.00%)` | :arrow_down: |
   | [protocol/dubbo/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vcG9vbC5nbw==) | `76.71% <0.00%> (-4.57%)` | :arrow_down: |
   | [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `78.49% <0.00%> (-2.16%)` | :arrow_down: |
   | [protocol/dubbo/client.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZHViYm8vY2xpZW50Lmdv) | `67.87% <0.00%> (-1.22%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `56.07% <0.00%> (ø)` | |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/601/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `79.24% <0.00%> (+0.94%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/601?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/apache/dubbo-go/pull/601?src=pr&el=footer). Last update [669301f...df758dc](https://codecov.io/gh/apache/dubbo-go/pull/601?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on a change in pull request #601: Zk client

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r439742050



##########
File path: remoting/zookeeper/client_test.go
##########
@@ -18,14 +18,17 @@
 package zookeeper
 
 import (
-	"fmt"
 	"testing"
 	"time"
 )
 
 import (
 	"github.com/dubbogo/go-zookeeper/zk"
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"

Review comment:
       I think u can rollback the testify/require to testify/assert package.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] gaoxinge commented on a change in pull request #601: Imp: Zk client

Posted by GitBox <gi...@apache.org>.
gaoxinge commented on a change in pull request #601:
URL: https://github.com/apache/dubbo-go/pull/601#discussion_r440239055



##########
File path: remoting/zookeeper/client_test.go
##########
@@ -18,14 +18,17 @@
 package zookeeper
 
 import (
-	"fmt"
 	"testing"
 	"time"
 )
 
 import (
 	"github.com/dubbogo/go-zookeeper/zk"
-	"github.com/stretchr/testify/assert"
+	"github.com/stretchr/testify/require"

Review comment:
       ## an example
   
   ```go
   func TestSomething(t *testing.T) {
   	var err error
   
   	err = perrors.Errorf("something1")
   	assert.NoError(t, err)
   
   	err = perrors.Errorf("something2")
   	assert.NoError(t, err)
   }
   ```
   
   - use `testify/assert` will output two errors on console:
   
   ```
   === RUN   TestSomething
   --- FAIL: TestSomething (0.00s)
       client_test.go:151: 
           	Error Trace:	client_test.go:151
           	Error:      	Received unexpected error:
           	            	something1
           	            	github.com/apache/dubbo-go/remoting/zookeeper.TestSomething
           	            		D:/GoPath/src/github.com/apache/dubbo-go/remoting/zookeeper/client_test.go:150
           	            	testing.tRunner
           	            		D:/Go/src/testing/testing.go:909
           	            	runtime.goexit
           	            		D:/Go/src/runtime/asm_amd64.s:1357
           	Test:       	TestSomething
       client_test.go:154: 
           	Error Trace:	client_test.go:154
           	Error:      	Received unexpected error:
           	            	something2
           	            	github.com/apache/dubbo-go/remoting/zookeeper.TestSomething
           	            		D:/GoPath/src/github.com/apache/dubbo-go/remoting/zookeeper/client_test.go:153
           	            	testing.tRunner
           	            		D:/Go/src/testing/testing.go:909
           	            	runtime.goexit
           	            		D:/Go/src/runtime/asm_amd64.s:1357
           	Test:       	TestSomething
   FAIL
   ``` 
   
   - use `testify/require` just output the first error and stop the test case intermediately
   
   ## why I prefer `testify/require`
   
   - Because errors in test case may have some dependency: first error causes second error, then I think it's better to use `tesify/require`, which only shows the first error.
   - Using `tesify/assert` may output too many errors, but developers only need to focus on fixing the first error.  
   
   @AlexStocks 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org