tianxiaoliang commented on a change in pull request #958:
URL: 
https://github.com/apache/servicecomb-service-center/pull/958#discussion_r620810577



##########
File path: server/plugin/discovery/config_test.go
##########
@@ -74,7 +75,7 @@ func TestConfigure(t *testing.T) {
        if cfg.Parser != proto.MapParser {
                t.Fatalf("TestConfigure failed")
        }
-       if cfg.String() != "{key: /test, timeout: 2s, period: 3s, lease: 
false}" {
+       if !strings.HasPrefix(cfg.String(), "{key:") {
                t.Fatalf("TestConfigure failed")

Review comment:
       凡是涉及ut更新,全都改造为断言,不要if

##########
File path: server/plugin/discovery/etcd/listwatch.go
##########
@@ -19,23 +19,23 @@ package etcd
 import (
        "context"
        "fmt"
+       "github.com/apache/servicecomb-service-center/server/plugin/discovery"
        "github.com/apache/servicecomb-service-center/server/plugin/registry"
-       "time"
 )
 
 type ListWatchConfig struct {
-       Timeout time.Duration
+       *discovery.Config
        Context context.Context
 }
 
 func (lo *ListWatchConfig) String() string {
-       return fmt.Sprintf("{timeout: %s}", lo.Timeout)
+       return fmt.Sprintf("{Config: %v, timeout: %s}", lo.Config, lo.Timeout)
 }
 
 type ListWatch interface {
-       List(op ListWatchConfig) (*registry.PluginResponse, error)
+       List(cfg ListWatchConfig) (*registry.PluginResponse, error)

Review comment:
       我建议结构体叫Option




-- 
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:
[email protected]


Reply via email to