From e060a3e5aacfc02821be19db47406eab56256fb4 Mon Sep 17 00:00:00 2001 From: Joe Zou <yixian.zou@gmail.com> Date: Tue, 31 Dec 2019 15:30:42 +0800 Subject: [PATCH] fix review problems --- common/url.go | 2 +- config/condition_router_config.go | 1 - config_center/dynamic_configuration.go | 4 ---- config_center/mock_dynamic_config.go | 9 --------- registry/directory/directory_test.go | 2 +- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/common/url.go b/common/url.go index 4fd0ac3f7..fadec7acf 100644 --- a/common/url.go +++ b/common/url.go @@ -313,7 +313,7 @@ func (c *URL) GetBackupUrls() []*URL { WithUsername(c.Username), WithPassword(c.Password), WithPort(port), - WithParams(c.Params)) + WithParams(c.params)) urls = append(urls, newURL) } diff --git a/config/condition_router_config.go b/config/condition_router_config.go index 77ab227ce..41af2a9cf 100644 --- a/config/condition_router_config.go +++ b/config/condition_router_config.go @@ -18,7 +18,6 @@ package config import ( "encoding/base64" - "fmt" "io/ioutil" "net/url" "os" diff --git a/config_center/dynamic_configuration.go b/config_center/dynamic_configuration.go index 1efac1578..0546d3973 100644 --- a/config_center/dynamic_configuration.go +++ b/config_center/dynamic_configuration.go @@ -44,10 +44,6 @@ type DynamicConfiguration interface { //GetInternalProperty get value by key in Default properties file(dubbo.properties) GetInternalProperty(string, ...Option) (string, error) - - GetConfig(string, ...Option) (string, error) - SetConfig(string, string, string) error - GetConfigs(string, ...Option) (string, error) } type Options struct { diff --git a/config_center/mock_dynamic_config.go b/config_center/mock_dynamic_config.go index 7cc758cc1..dd1610f06 100644 --- a/config_center/mock_dynamic_config.go +++ b/config_center/mock_dynamic_config.go @@ -97,15 +97,6 @@ func (c *MockDynamicConfiguration) GetConfig(key string, opts ...Option) (string return c.content, nil } -func (c *mockDynamicConfiguration) SetConfig(group string, key string, value string) error { - return nil -} - -//For zookeeper, getConfig and getConfigs have the same meaning. -func (c *MockDynamicConfiguration) GetConfigs(key string, opts ...Option) (string, error) { - return c.GetConfig(key, opts...) -} - func (c *MockDynamicConfiguration) Parser() parser.ConfigurationParser { return c.parser } diff --git a/registry/directory/directory_test.go b/registry/directory/directory_test.go index 973443901..e9f62dc56 100644 --- a/registry/directory/directory_test.go +++ b/registry/directory/directory_test.go @@ -118,7 +118,7 @@ func Test_List(t *testing.T) { registryDirectory, _ := normalRegistryDir() time.Sleep(1e9) - invokers, _ := registryDirectory.List(&invocation.RPCInvocation{}) + invokers := registryDirectory.List(&invocation.RPCInvocation{}) assert.Len(t, invokers, 3) assert.Equal(t, true, registryDirectory.IsAvailable()) -- GitLab