From 667540a5a68b0f45da34b57bd232bbc4b3c605ad Mon Sep 17 00:00:00 2001
From: lihaowei <2421565398@qq.com>
Date: Sun, 19 Jul 2020 18:37:29 +0800
Subject: [PATCH] Imp: add some comments

---
 NOTICE                                        |  2 +-
 .../cluster_impl/broadcast_cluster_invoker.go |  1 +
 common/constant/env.go                        |  1 +
 config/base_config_test.go                    |  8 +++---
 config/config_loader_test.go                  |  4 +--
 config/method_config.go                       |  4 +--
 config/reference_config.go                    |  2 +-
 config/reference_config_test.go               |  8 +++---
 config/service_config.go                      |  2 +-
 config/service_config_test.go                 |  8 +++---
 config_center/apollo/factory.go               |  1 +
 config_center/mock_dynamic_config.go          |  8 +++---
 config_center/parser/configuration_parser.go  | 17 +++++++----
 config_center/zookeeper/listener.go           |  2 +-
 filter/filter.go                              |  2 +-
 filter/filter_impl/access_log_filter.go       | 12 ++++----
 filter/filter_impl/echo_filter.go             |  2 +-
 filter/filter_impl/execute_limit_filter.go    |  2 +-
 filter/filter_impl/generic_filter.go          |  2 +-
 filter/filter_impl/generic_service_filter.go  | 12 ++++----
 .../generic_service_filter_test.go            |  4 +--
 filter/filter_impl/hystrix_filter.go          | 16 +++++------
 filter/filter_impl/token_filter.go            |  4 +--
 .../tps/tps_limit_fix_window_strategy.go      |  2 +-
 .../tps/tps_limit_strategy_mock.go            |  5 +++-
 filter/filter_impl/tracing_filter_test.go     |  5 +---
 go.mod                                        |  2 --
 .../exporter/configurable/exporter_test.go    |  4 +--
 protocol/dubbo/codec.go                       |  6 ++--
 protocol/grpc/grpc_exporter.go                |  2 +-
 protocol/grpc/grpc_invoker.go                 | 12 ++++----
 protocol/jsonrpc/http.go                      |  2 +-
 protocol/jsonrpc/json.go                      |  2 +-
 .../protocol_filter_wrapper.go                | 12 ++++----
 protocol/rest/config/rest_config.go           | 28 +++++++++----------
 protocol/rest/rest_exporter.go                |  3 ++
 protocol/rest/rest_invoker.go                 |  5 ++++
 protocol/rest/rest_protocol.go                |  9 ++++++
 .../subscribed_urls_synthesizer.go            |  1 +
 remoting/listener.go                          |  2 ++
 40 files changed, 126 insertions(+), 100 deletions(-)

diff --git a/NOTICE b/NOTICE
index d7aa899d1..1120c200c 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,4 +1,4 @@
-Apache Dubbo Go
+Apache Dubbo-go
 Copyright 2018-2020 The Apache Software Foundation
 
 This product includes software developed at
diff --git a/cluster/cluster_impl/broadcast_cluster_invoker.go b/cluster/cluster_impl/broadcast_cluster_invoker.go
index 3a97d3d9b..b117dbb24 100644
--- a/cluster/cluster_impl/broadcast_cluster_invoker.go
+++ b/cluster/cluster_impl/broadcast_cluster_invoker.go
@@ -36,6 +36,7 @@ func newBroadcastClusterInvoker(directory cluster.Directory) protocol.Invoker {
 	}
 }
 
+// nolint
 func (invoker *broadcastClusterInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
 	invokers := invoker.directory.List(invocation)
 	err := invoker.checkInvokers(invokers, invocation)
diff --git a/common/constant/env.go b/common/constant/env.go
index 537632332..f8402b9cb 100644
--- a/common/constant/env.go
+++ b/common/constant/env.go
@@ -17,6 +17,7 @@
 
 package constant
 
+// nolint
 const (
 	// CONF_CONSUMER_FILE_PATH ...
 	CONF_CONSUMER_FILE_PATH = "CONF_CONSUMER_FILE_PATH"
diff --git a/config/base_config_test.go b/config/base_config_test.go
index 15b468753..6db6a8dcb 100644
--- a/config/base_config_test.go
+++ b/config/base_config_test.go
@@ -95,14 +95,14 @@ var baseMockRef = map[string]*ReferenceConfig{
 				InterfaceName: "com.MockService",
 				Name:          "GetUser",
 				Retries:       "2",
-				Loadbalance:   "random",
+				LoadBalance:   "random",
 			},
 			{
 				InterfaceId:   "MockService",
 				InterfaceName: "com.MockService",
 				Name:          "GetUser1",
 				Retries:       "2",
-				Loadbalance:   "random",
+				LoadBalance:   "random",
 			},
 		},
 	},
@@ -258,14 +258,14 @@ func TestRefreshProvider(t *testing.T) {
 						InterfaceName: "com.MockService",
 						Name:          "GetUser",
 						Retries:       "2",
-						Loadbalance:   "random",
+						LoadBalance:   "random",
 					},
 					{
 						InterfaceId:   "MockService",
 						InterfaceName: "com.MockService",
 						Name:          "GetUser1",
 						Retries:       "2",
-						Loadbalance:   "random",
+						LoadBalance:   "random",
 					},
 				},
 			},
diff --git a/config/config_loader_test.go b/config/config_loader_test.go
index 2cbf526a7..01d2ca812 100644
--- a/config/config_loader_test.go
+++ b/config/config_loader_test.go
@@ -278,13 +278,13 @@ func mockInitProviderWithSingleRegistry() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 				},
diff --git a/config/method_config.go b/config/method_config.go
index e64773eb1..b64306fd6 100644
--- a/config/method_config.go
+++ b/config/method_config.go
@@ -25,13 +25,13 @@ import (
 	"github.com/apache/dubbo-go/common/constant"
 )
 
-// MethodConfig ...
+// MethodConfig defines method config
 type MethodConfig struct {
 	InterfaceId                 string
 	InterfaceName               string
 	Name                        string `yaml:"name"  json:"name,omitempty" property:"name"`
 	Retries                     string `yaml:"retries"  json:"retries,omitempty" property:"retries"`
-	Loadbalance                 string `yaml:"loadbalance"  json:"loadbalance,omitempty" property:"loadbalance"`
+	LoadBalance                 string `yaml:"loadbalance"  json:"loadbalance,omitempty" property:"loadbalance"`
 	Weight                      int64  `yaml:"weight"  json:"weight,omitempty" property:"weight"`
 	TpsLimitInterval            string `yaml:"tps.limit.interval" json:"tps.limit.interval,omitempty" property:"tps.limit.interval"`
 	TpsLimitRate                string `yaml:"tps.limit.rate" json:"tps.limit.rate,omitempty" property:"tps.limit.rate"`
diff --git a/config/reference_config.go b/config/reference_config.go
index 748b2d403..e9a895d57 100644
--- a/config/reference_config.go
+++ b/config/reference_config.go
@@ -220,7 +220,7 @@ func (c *ReferenceConfig) getUrlMap() url.Values {
 	urlMap.Set(constant.REFERENCE_FILTER_KEY, mergeValue(consumerConfig.Filter, c.Filter, defaultReferenceFilter))
 
 	for _, v := range c.Methods {
-		urlMap.Set("methods."+v.Name+"."+constant.LOADBALANCE_KEY, v.Loadbalance)
+		urlMap.Set("methods."+v.Name+"."+constant.LOADBALANCE_KEY, v.LoadBalance)
 		urlMap.Set("methods."+v.Name+"."+constant.RETRIES_KEY, v.Retries)
 		urlMap.Set("methods."+v.Name+"."+constant.STICKY_KEY, strconv.FormatBool(v.Sticky))
 		if len(v.RequestTimeout) != 0 {
diff --git a/config/reference_config_test.go b/config/reference_config_test.go
index 3fbf8da44..45cdb2dfa 100644
--- a/config/reference_config_test.go
+++ b/config/reference_config_test.go
@@ -103,12 +103,12 @@ func doInitConsumer() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Sticky:      true,
 					},
 				},
@@ -174,12 +174,12 @@ func doInitConsumerWithSingleRegistry() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 					},
 				},
 			},
diff --git a/config/service_config.go b/config/service_config.go
index 57fce028f..4351eea7c 100644
--- a/config/service_config.go
+++ b/config/service_config.go
@@ -303,7 +303,7 @@ func (c *ServiceConfig) getUrlMap() url.Values {
 
 	for _, v := range c.Methods {
 		prefix := "methods." + v.Name + "."
-		urlMap.Set(prefix+constant.LOADBALANCE_KEY, v.Loadbalance)
+		urlMap.Set(prefix+constant.LOADBALANCE_KEY, v.LoadBalance)
 		urlMap.Set(prefix+constant.RETRIES_KEY, v.Retries)
 		urlMap.Set(prefix+constant.WEIGHT_KEY, strconv.FormatInt(v.Weight, 10))
 
diff --git a/config/service_config_test.go b/config/service_config_test.go
index e7d55077b..0f7e404f6 100644
--- a/config/service_config_test.go
+++ b/config/service_config_test.go
@@ -56,13 +56,13 @@ func doInitProvider() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 				},
@@ -81,13 +81,13 @@ func doInitProvider() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 				},
diff --git a/config_center/apollo/factory.go b/config_center/apollo/factory.go
index f975ce13d..8d873eaab 100644
--- a/config_center/apollo/factory.go
+++ b/config_center/apollo/factory.go
@@ -34,6 +34,7 @@ func createDynamicConfigurationFactory() config_center.DynamicConfigurationFacto
 
 type apolloConfigurationFactory struct{}
 
+// GetDynamicConfiguration returns the dynamic configuration
 func (f *apolloConfigurationFactory) GetDynamicConfiguration(url *common.URL) (config_center.DynamicConfiguration, error) {
 	dynamicConfiguration, err := newApolloConfiguration(url)
 	if err != nil {
diff --git a/config_center/mock_dynamic_config.go b/config_center/mock_dynamic_config.go
index de208946f..8fe0a2512 100644
--- a/config_center/mock_dynamic_config.go
+++ b/config_center/mock_dynamic_config.go
@@ -33,7 +33,7 @@ import (
 	"github.com/apache/dubbo-go/remoting"
 )
 
-// MockDynamicConfigurationFactory ...
+// MockDynamicConfigurationFactory defines content
 type MockDynamicConfigurationFactory struct {
 	Content string
 }
@@ -96,7 +96,7 @@ func (c *MockDynamicConfiguration) GetConfigKeysByGroup(group string) (*gxset.Ha
 	return gxset.NewSet(c.content), nil
 }
 
-// MockDynamicConfiguration ...
+// MockDynamicConfiguration uses to parse content and defines listener
 type MockDynamicConfiguration struct {
 	parser   parser.ConfigurationParser
 	content  string
@@ -149,7 +149,7 @@ func (c *MockDynamicConfiguration) GetRule(key string, opts ...Option) (string,
 	return c.GetProperties(key, opts...)
 }
 
-// MockServiceConfigEvent ...
+// MockServiceConfigEvent returns ConfiguratorConfig
 func (c *MockDynamicConfiguration) MockServiceConfigEvent() {
 	config := &parser.ConfiguratorConfig{
 		ConfigVersion: "2.7.1",
@@ -171,7 +171,7 @@ func (c *MockDynamicConfiguration) MockServiceConfigEvent() {
 	c.listener[key].Process(&ConfigChangeEvent{Key: key, Value: string(value), ConfigType: remoting.EventTypeAdd})
 }
 
-// MockApplicationConfigEvent ...
+// MockApplicationConfigEvent returns ConfiguratorConfig
 func (c *MockDynamicConfiguration) MockApplicationConfigEvent() {
 	config := &parser.ConfiguratorConfig{
 		ConfigVersion: "2.7.1",
diff --git a/config_center/parser/configuration_parser.go b/config_center/parser/configuration_parser.go
index 6fbdc27d4..f794221f9 100644
--- a/config_center/parser/configuration_parser.go
+++ b/config_center/parser/configuration_parser.go
@@ -35,13 +35,13 @@ import (
 )
 
 const (
-	// ScopeApplication ...
+	// ScopeApplication : scope application
 	ScopeApplication = "application"
-	// GeneralType ...
+	// GeneralType defines the general type
 	GeneralType = "general"
 )
 
-// ConfigurationParser ...
+// ConfigurationParser interface
 type ConfigurationParser interface {
 	Parse(string) (map[string]string, error)
 	ParseToUrls(content string) ([]*common.URL, error)
@@ -50,7 +50,7 @@ type ConfigurationParser interface {
 // DefaultConfigurationParser for supporting properties file in config center
 type DefaultConfigurationParser struct{}
 
-// ConfiguratorConfig ...
+// ConfiguratorConfig defines configurator config
 type ConfiguratorConfig struct {
 	ConfigVersion string       `yaml:"configVersion"`
 	Scope         string       `yaml:"scope"`
@@ -59,7 +59,7 @@ type ConfiguratorConfig struct {
 	Configs       []ConfigItem `yaml:"configs"`
 }
 
-// ConfigItem ...
+// ConfigItem defines config item
 type ConfigItem struct {
 	Type              string            `yaml:"type"`
 	Enabled           bool              `yaml:"enabled"`
@@ -81,7 +81,7 @@ func (parser *DefaultConfigurationParser) Parse(content string) (map[string]stri
 	return pps.Map(), nil
 }
 
-// ParseToUrls ...
+// ParseToUrls is used to parse content to urls
 func (parser *DefaultConfigurationParser) ParseToUrls(content string) ([]*common.URL, error) {
 	config := ConfiguratorConfig{}
 	if err := yaml.Unmarshal([]byte(content), &config); err != nil {
@@ -110,6 +110,7 @@ func (parser *DefaultConfigurationParser) ParseToUrls(content string) ([]*common
 	return allUrls, nil
 }
 
+// serviceItemToUrls is used to transfer item and config to urls
 func serviceItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.URL, error) {
 	var addresses = item.Addresses
 	if len(addresses) == 0 {
@@ -156,6 +157,7 @@ func serviceItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.UR
 	return urls, nil
 }
 
+// nolint
 func appItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.URL, error) {
 	var addresses = item.Addresses
 	if len(addresses) == 0 {
@@ -196,6 +198,7 @@ func appItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.URL, e
 	return urls, nil
 }
 
+// getServiceString returns service string
 func getServiceString(service string) (string, error) {
 	if len(service) == 0 {
 		return "", perrors.New("service field in configuration is null.")
@@ -219,6 +222,7 @@ func getServiceString(service string) (string, error) {
 	return serviceStr, nil
 }
 
+// nolint
 func getParamString(item ConfigItem) (string, error) {
 	var retStr string
 	retStr = retStr + "category="
@@ -241,6 +245,7 @@ func getParamString(item ConfigItem) (string, error) {
 	return retStr, nil
 }
 
+// getEnabledString returns enabled string
 func getEnabledString(item ConfigItem, config ConfiguratorConfig) string {
 	retStr := "&enabled="
 	if len(item.Type) == 0 || item.Type == GeneralType {
diff --git a/config_center/zookeeper/listener.go b/config_center/zookeeper/listener.go
index 747c4be35..bc6eb6d6e 100644
--- a/config_center/zookeeper/listener.go
+++ b/config_center/zookeeper/listener.go
@@ -27,7 +27,7 @@ import (
 	"github.com/apache/dubbo-go/remoting"
 )
 
-// CacheListener ...
+// CacheListener defines keyListeners and rootPath
 type CacheListener struct {
 	keyListeners sync.Map
 	rootPath     string
diff --git a/filter/filter.go b/filter/filter.go
index d20ca72c3..804bf3b9d 100644
--- a/filter/filter.go
+++ b/filter/filter.go
@@ -27,7 +27,7 @@ import (
 // Filter interface defines the functions of a filter
 // Extension - Filter
 type Filter interface {
-	// Invoke is the core function of a filter, it determins the process of the filter
+	// Invoke is the core function of a filter, it determines the process of the filter
 	Invoke(context.Context, protocol.Invoker, protocol.Invocation) protocol.Result
 	// OnResponse updates the results from Invoke and then returns the modified results.
 	OnResponse(context.Context, protocol.Result, protocol.Invoker, protocol.Invocation) protocol.Result
diff --git a/filter/filter_impl/access_log_filter.go b/filter/filter_impl/access_log_filter.go
index 49cdc2287..621012c24 100644
--- a/filter/filter_impl/access_log_filter.go
+++ b/filter/filter_impl/access_log_filter.go
@@ -36,20 +36,20 @@ import (
 const (
 	//used in URL.
 
-	// FileDateFormat ...
+	// nolint
 	FileDateFormat = "2006-01-02"
-	// MessageDateLayout ...
+	// nolint
 	MessageDateLayout = "2006-01-02 15:04:05"
-	// LogMaxBuffer ...
+	// nolint
 	LogMaxBuffer = 5000
-	// LogFileMode ...
+	// nolint
 	LogFileMode = 0600
 
 	// those fields are the data collected by this filter
 
-	// Types ...
+	// nolint
 	Types = "types"
-	// Arguments ...
+	// nolint
 	Arguments = "arguments"
 )
 
diff --git a/filter/filter_impl/echo_filter.go b/filter/filter_impl/echo_filter.go
index 7da5ec702..06e443e80 100644
--- a/filter/filter_impl/echo_filter.go
+++ b/filter/filter_impl/echo_filter.go
@@ -65,7 +65,7 @@ func (ef *EchoFilter) OnResponse(_ context.Context, result protocol.Result, _ pr
 	return result
 }
 
-// GetFilter ...
+// GetFilter returns the Filter
 func GetFilter() filter.Filter {
 	return &EchoFilter{}
 }
diff --git a/filter/filter_impl/execute_limit_filter.go b/filter/filter_impl/execute_limit_filter.go
index bfc5096ca..5fc309cfb 100644
--- a/filter/filter_impl/execute_limit_filter.go
+++ b/filter/filter_impl/execute_limit_filter.go
@@ -74,7 +74,7 @@ type ExecuteLimitFilter struct {
 	executeState *concurrent.Map
 }
 
-// ExecuteState ...
+// ExecuteState defines the concurrent count
 type ExecuteState struct {
 	concurrentCount int64
 }
diff --git a/filter/filter_impl/generic_filter.go b/filter/filter_impl/generic_filter.go
index 3f4d714e6..d385054ed 100644
--- a/filter/filter_impl/generic_filter.go
+++ b/filter/filter_impl/generic_filter.go
@@ -47,7 +47,7 @@ func init() {
 
 //  when do a generic invoke, struct need to be map
 
-// GenericFilter ...
+// nolint
 type GenericFilter struct{}
 
 // Invoke turns the parameters to map for generic method
diff --git a/filter/filter_impl/generic_service_filter.go b/filter/filter_impl/generic_service_filter.go
index 6272df6b3..3711e68cc 100644
--- a/filter/filter_impl/generic_service_filter.go
+++ b/filter/filter_impl/generic_service_filter.go
@@ -40,9 +40,9 @@ import (
 )
 
 const (
-	// GENERIC_SERVICE ...
+	// GENERIC_SERVICE defines the filter name
 	GENERIC_SERVICE = "generic_service"
-	// GENERIC_SERIALIZATION_DEFAULT ...
+	// nolint
 	GENERIC_SERIALIZATION_DEFAULT = "true"
 )
 
@@ -50,10 +50,10 @@ func init() {
 	extension.SetFilter(GENERIC_SERVICE, GetGenericServiceFilter)
 }
 
-// GenericServiceFilter ...
+// nolint
 type GenericServiceFilter struct{}
 
-// Invoke ...
+// Invoke is used to call service method by invocation
 func (ef *GenericServiceFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
 	logger.Infof("invoking generic service filter.")
 	logger.Debugf("generic service filter methodName:%v,args:%v", invocation.MethodName(), len(invocation.Arguments()))
@@ -115,7 +115,7 @@ func (ef *GenericServiceFilter) Invoke(ctx context.Context, invoker protocol.Inv
 	return invoker.Invoke(ctx, newInvocation)
 }
 
-// OnResponse ...
+// nolint
 func (ef *GenericServiceFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
 	if invocation.MethodName() == constant.GENERIC && len(invocation.Arguments()) == 3 && result.Result() != nil {
 		v := reflect.ValueOf(result.Result())
@@ -127,7 +127,7 @@ func (ef *GenericServiceFilter) OnResponse(ctx context.Context, result protocol.
 	return result
 }
 
-// GetGenericServiceFilter ...
+// nolint
 func GetGenericServiceFilter() filter.Filter {
 	return &GenericServiceFilter{}
 }
diff --git a/filter/filter_impl/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go
index f0bdb7fb3..67819717c 100644
--- a/filter/filter_impl/generic_service_filter_test.go
+++ b/filter/filter_impl/generic_service_filter_test.go
@@ -51,7 +51,7 @@ func (c *TestStruct) JavaClassName() string {
 
 type TestService struct{}
 
-// MethodOne ...
+// nolint
 func (ts *TestService) MethodOne(_ context.Context, test1 *TestStruct, test2 []TestStruct,
 	test3 interface{}, test4 []interface{}, test5 *string) (*TestStruct, error) {
 	if test1 == nil {
@@ -72,7 +72,7 @@ func (ts *TestService) MethodOne(_ context.Context, test1 *TestStruct, test2 []T
 	return &TestStruct{}, nil
 }
 
-// Reference ...
+// nolint
 func (*TestService) Reference() string {
 	return "com.test.Path"
 }
diff --git a/filter/filter_impl/hystrix_filter.go b/filter/filter_impl/hystrix_filter.go
index 711ef71c4..e2275149f 100644
--- a/filter/filter_impl/hystrix_filter.go
+++ b/filter/filter_impl/hystrix_filter.go
@@ -37,11 +37,11 @@ import (
 )
 
 const (
-	// HYSTRIX_CONSUMER ...
+	// nolint
 	HYSTRIX_CONSUMER = "hystrix_consumer"
-	// HYSTRIX_PROVIDER ...
+	// nolint
 	HYSTRIX_PROVIDER = "hystrix_provider"
-	// HYSTRIX ...
+	// nolint
 	HYSTRIX = "hystrix"
 )
 
@@ -85,14 +85,14 @@ func NewHystrixFilterError(err error, failByHystrix bool) error {
 	}
 }
 
-// HystrixFilter ...
+// nolint
 type HystrixFilter struct {
 	COrP     bool //true for consumer
 	res      map[string][]*regexp.Regexp
 	ifNewMap sync.Map
 }
 
-// Invoke is an implentation of filter, provides Hystrix pattern latency and fault tolerance
+// Invoke is an implementation of filter, provides Hystrix pattern latency and fault tolerance
 func (hf *HystrixFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result {
 	cmdName := fmt.Sprintf("%s&method=%s", invoker.GetUrl().Key(), invocation.MethodName())
 
@@ -256,7 +256,7 @@ func initHystrixConfigProvider() error {
 //	return initHystrixConfig()
 //}
 
-// CommandConfigWithError ...
+// nolint
 type CommandConfigWithError struct {
 	Timeout                int      `yaml:"timeout"`
 	MaxConcurrentRequests  int      `yaml:"max_concurrent_requests"`
@@ -274,14 +274,14 @@ type CommandConfigWithError struct {
 //- ErrorPercentThreshold: it causes circuits to open once the rolling measure of errors exceeds this percent of requests
 //See hystrix doc
 
-// HystrixFilterConfig ...
+// nolint
 type HystrixFilterConfig struct {
 	Configs  map[string]*CommandConfigWithError
 	Default  string
 	Services map[string]ServiceHystrixConfig
 }
 
-// ServiceHystrixConfig ...
+// nolint
 type ServiceHystrixConfig struct {
 	ServiceConfig string `yaml:"service_config"`
 	Methods       map[string]string
diff --git a/filter/filter_impl/token_filter.go b/filter/filter_impl/token_filter.go
index 23742c66e..fe4e38747 100644
--- a/filter/filter_impl/token_filter.go
+++ b/filter/filter_impl/token_filter.go
@@ -34,7 +34,7 @@ import (
 )
 
 const (
-	// TOKEN ...
+	// nolint
 	TOKEN = "token"
 )
 
@@ -66,7 +66,7 @@ func (tf *TokenFilter) OnResponse(ctx context.Context, result protocol.Result, i
 	return result
 }
 
-// GetTokenFilter ...
+// nolint
 func GetTokenFilter() filter.Filter {
 	return &TokenFilter{}
 }
diff --git a/filter/filter_impl/tps/tps_limit_fix_window_strategy.go b/filter/filter_impl/tps/tps_limit_fix_window_strategy.go
index 7419a4576..d495e035d 100644
--- a/filter/filter_impl/tps/tps_limit_fix_window_strategy.go
+++ b/filter/filter_impl/tps/tps_limit_fix_window_strategy.go
@@ -29,7 +29,7 @@ import (
 )
 
 const (
-	// FixedWindowKey ...
+	// FixedWindowKey defines tps limit algorithm
 	FixedWindowKey = "fixedWindow"
 )
 
diff --git a/filter/filter_impl/tps/tps_limit_strategy_mock.go b/filter/filter_impl/tps/tps_limit_strategy_mock.go
index c228c7349..3a1688e4d 100644
--- a/filter/filter_impl/tps/tps_limit_strategy_mock.go
+++ b/filter/filter_impl/tps/tps_limit_strategy_mock.go
@@ -23,7 +23,10 @@ package tps
 
 import (
 	gomock "github.com/golang/mock/gomock"
-	reflect "reflect"
+)
+
+import (
+	"reflect"
 )
 
 // MockTpsLimitStrategy is a mock of TpsLimitStrategy interface
diff --git a/filter/filter_impl/tracing_filter_test.go b/filter/filter_impl/tracing_filter_test.go
index 15dc32e7e..57f4095d4 100644
--- a/filter/filter_impl/tracing_filter_test.go
+++ b/filter/filter_impl/tracing_filter_test.go
@@ -26,12 +26,9 @@ import (
 	"github.com/opentracing/opentracing-go"
 )
 
-import (
-	"github.com/apache/dubbo-go/common/constant"
-)
-
 import (
 	"github.com/apache/dubbo-go/common"
+	"github.com/apache/dubbo-go/common/constant"
 	"github.com/apache/dubbo-go/protocol"
 	"github.com/apache/dubbo-go/protocol/invocation"
 )
diff --git a/go.mod b/go.mod
index e82a04b27..a16b90622 100644
--- a/go.mod
+++ b/go.mod
@@ -3,9 +3,7 @@ module github.com/apache/dubbo-go
 require (
 	github.com/Workiva/go-datastructures v1.0.50
 	github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
-	github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 // indirect
 	github.com/apache/dubbo-go-hessian2 v1.6.1
-	github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
 	github.com/coreos/bbolt v1.3.3 // indirect
 	github.com/coreos/etcd v3.3.13+incompatible
 	github.com/coreos/go-semver v0.3.0 // indirect
diff --git a/metadata/service/exporter/configurable/exporter_test.go b/metadata/service/exporter/configurable/exporter_test.go
index 4689c6660..9fdbd7675 100644
--- a/metadata/service/exporter/configurable/exporter_test.go
+++ b/metadata/service/exporter/configurable/exporter_test.go
@@ -97,13 +97,13 @@ func mockInitProviderWithSingleRegistry() {
 					{
 						Name:        "GetUser",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 					{
 						Name:        "GetUser1",
 						Retries:     "2",
-						Loadbalance: "random",
+						LoadBalance: "random",
 						Weight:      200,
 					},
 				},
diff --git a/protocol/dubbo/codec.go b/protocol/dubbo/codec.go
index 1f7d10754..8ba725e3c 100644
--- a/protocol/dubbo/codec.go
+++ b/protocol/dubbo/codec.go
@@ -54,10 +54,10 @@ const (
 // dubbo package
 ////////////////////////////////////////////
 
-// SequenceType ...
+// SequenceType sequence type
 type SequenceType int64
 
-// DubboPackage ...
+// nolint
 type DubboPackage struct {
 	Header  hessian.DubboHeader
 	Service hessian.Service
@@ -82,7 +82,7 @@ func (p *DubboPackage) Marshal() (*bytes.Buffer, error) {
 	return bytes.NewBuffer(pkg), nil
 }
 
-// Unmarshal dncode hessian package.
+// Unmarshal decode hessian package.
 func (p *DubboPackage) Unmarshal(buf *bytes.Buffer, opts ...interface{}) error {
 	// fix issue https://github.com/apache/dubbo-go/issues/380
 	bufLen := buf.Len()
diff --git a/protocol/grpc/grpc_exporter.go b/protocol/grpc/grpc_exporter.go
index 79962b59e..0dc764854 100644
--- a/protocol/grpc/grpc_exporter.go
+++ b/protocol/grpc/grpc_exporter.go
@@ -28,7 +28,7 @@ import (
 	"github.com/apache/dubbo-go/protocol"
 )
 
-// GrpcExporter ...
+// nolint
 type GrpcExporter struct {
 	*protocol.BaseExporter
 }
diff --git a/protocol/grpc/grpc_invoker.go b/protocol/grpc/grpc_invoker.go
index e150d05e6..737e8c40a 100644
--- a/protocol/grpc/grpc_invoker.go
+++ b/protocol/grpc/grpc_invoker.go
@@ -37,14 +37,14 @@ import (
 
 var errNoReply = errors.New("request need @response")
 
-// GrpcInvoker ...
+// nolint
 type GrpcInvoker struct {
 	protocol.BaseInvoker
 	quitOnce sync.Once
 	client   *Client
 }
 
-// NewGrpcInvoker ...
+// NewGrpcInvoker returns a Grpc invoker instance
 func NewGrpcInvoker(url common.URL, client *Client) *GrpcInvoker {
 	return &GrpcInvoker{
 		BaseInvoker: *protocol.NewBaseInvoker(url),
@@ -52,7 +52,7 @@ func NewGrpcInvoker(url common.URL, client *Client) *GrpcInvoker {
 	}
 }
 
-// Invoke ...
+// Invoke is used to call service method by invocation
 func (gi *GrpcInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
 	var (
 		result protocol.RPCResult
@@ -81,17 +81,17 @@ func (gi *GrpcInvoker) Invoke(ctx context.Context, invocation protocol.Invocatio
 	return &result
 }
 
-// IsAvailable ...
+// IsAvailable get available status
 func (gi *GrpcInvoker) IsAvailable() bool {
 	return gi.BaseInvoker.IsAvailable() && gi.client.GetState() != connectivity.Shutdown
 }
 
-// IsDestroyed ...
+// IsDestroyed get destroyed status
 func (gi *GrpcInvoker) IsDestroyed() bool {
 	return gi.BaseInvoker.IsDestroyed() && gi.client.GetState() == connectivity.Shutdown
 }
 
-// Destroy ...
+// Destroy will destroy gRPC's invoker and client, so it is only called once
 func (gi *GrpcInvoker) Destroy() {
 	gi.quitOnce.Do(func() {
 		gi.BaseInvoker.Destroy()
diff --git a/protocol/jsonrpc/http.go b/protocol/jsonrpc/http.go
index 5fca66d99..2a2ddfeee 100644
--- a/protocol/jsonrpc/http.go
+++ b/protocol/jsonrpc/http.go
@@ -47,7 +47,7 @@ import (
 // Request
 // ////////////////////////////////////////////
 
-// Request ...
+// Request is HTTP protocol request
 type Request struct {
 	ID          int64
 	group       string
diff --git a/protocol/jsonrpc/json.go b/protocol/jsonrpc/json.go
index 7b05a2294..506c4c953 100644
--- a/protocol/jsonrpc/json.go
+++ b/protocol/jsonrpc/json.go
@@ -288,7 +288,7 @@ type ServerCodec struct {
 
 var (
 	null = json.RawMessage([]byte("null"))
-	// Version ...
+	// Version is json RPC's version
 	Version = "2.0"
 )
 
diff --git a/protocol/protocolwrapper/protocol_filter_wrapper.go b/protocol/protocolwrapper/protocol_filter_wrapper.go
index cba1d5d5b..87f90d3b7 100644
--- a/protocol/protocolwrapper/protocol_filter_wrapper.go
+++ b/protocol/protocolwrapper/protocol_filter_wrapper.go
@@ -86,7 +86,7 @@ func buildInvokerChain(invoker protocol.Invoker, key string) protocol.Invoker {
 	return next
 }
 
-// GetProtocol ...
+// nolint
 func GetProtocol() protocol.Protocol {
 	return &ProtocolFilterWrapper{}
 }
@@ -95,30 +95,30 @@ func GetProtocol() protocol.Protocol {
 // filter invoker
 ///////////////////////////
 
-// FilterInvoker ...
+// FilterInvoker defines invoker and filter
 type FilterInvoker struct {
 	next    protocol.Invoker
 	invoker protocol.Invoker
 	filter  filter.Filter
 }
 
-// GetUrl ...
+// GetUrl is used to get url from FilterInvoker
 func (fi *FilterInvoker) GetUrl() common.URL {
 	return fi.invoker.GetUrl()
 }
 
-// IsAvailable ...
+// IsAvailable is used to get available status
 func (fi *FilterInvoker) IsAvailable() bool {
 	return fi.invoker.IsAvailable()
 }
 
-// Invoke ...
+// Invoke is used to call service method by invocation
 func (fi *FilterInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
 	result := fi.filter.Invoke(ctx, fi.next, invocation)
 	return fi.filter.OnResponse(ctx, result, fi.invoker, invocation)
 }
 
-// Destroy ...
+// Destroy will destroy invoker
 func (fi *FilterInvoker) Destroy() {
 	fi.invoker.Destroy()
 }
diff --git a/protocol/rest/config/rest_config.go b/protocol/rest/config/rest_config.go
index 168ec8ce5..4732dd8e4 100644
--- a/protocol/rest/config/rest_config.go
+++ b/protocol/rest/config/rest_config.go
@@ -26,7 +26,7 @@ var (
 	restProviderServiceConfigMap map[string]*RestServiceConfig
 )
 
-// RestConsumerConfig ...
+// nolint
 type RestConsumerConfig struct {
 	Client                string                        `default:"resty" yaml:"rest_client" json:"rest_client,omitempty" property:"rest_client"`
 	Produces              string                        `default:"application/json" yaml:"rest_produces"  json:"rest_produces,omitempty" property:"rest_produces"`
@@ -34,7 +34,7 @@ type RestConsumerConfig struct {
 	RestServiceConfigsMap map[string]*RestServiceConfig `yaml:"references" json:"references,omitempty" property:"references"`
 }
 
-// UnmarshalYAML ...
+// UnmarshalYAML unmarshals the RestConsumerConfig by @unmarshal function
 func (c *RestConsumerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
 	if err := defaults.Set(c); err != nil {
 		return err
@@ -46,7 +46,7 @@ func (c *RestConsumerConfig) UnmarshalYAML(unmarshal func(interface{}) error) er
 	return nil
 }
 
-// RestProviderConfig ...
+// nolint
 type RestProviderConfig struct {
 	Server                string                        `default:"go-restful" yaml:"rest_server" json:"rest_server,omitempty" property:"rest_server"`
 	Produces              string                        `default:"*/*" yaml:"rest_produces"  json:"rest_produces,omitempty" property:"rest_produces"`
@@ -54,7 +54,7 @@ type RestProviderConfig struct {
 	RestServiceConfigsMap map[string]*RestServiceConfig `yaml:"services" json:"services,omitempty" property:"services"`
 }
 
-// UnmarshalYAML ...
+// UnmarshalYAML unmarshals the RestProviderConfig by @unmarshal function
 func (c *RestProviderConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
 	if err := defaults.Set(c); err != nil {
 		return err
@@ -66,7 +66,7 @@ func (c *RestProviderConfig) UnmarshalYAML(unmarshal func(interface{}) error) er
 	return nil
 }
 
-// RestServiceConfig ...
+// nolint
 type RestServiceConfig struct {
 	InterfaceName        string              `required:"true"  yaml:"interface"  json:"interface,omitempty" property:"interface"`
 	Url                  string              `yaml:"url"  json:"url,omitempty" property:"url"`
@@ -80,7 +80,7 @@ type RestServiceConfig struct {
 	RestMethodConfigsMap map[string]*RestMethodConfig
 }
 
-// UnmarshalYAML ...
+// UnmarshalYAML unmarshals the RestServiceConfig by @unmarshal function
 func (c *RestServiceConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
 	if err := defaults.Set(c); err != nil {
 		return err
@@ -92,7 +92,7 @@ func (c *RestServiceConfig) UnmarshalYAML(unmarshal func(interface{}) error) err
 	return nil
 }
 
-// RestMethodConfig ...
+// nolint
 type RestMethodConfig struct {
 	InterfaceName  string
 	MethodName     string `required:"true" yaml:"name"  json:"name,omitempty" property:"name"`
@@ -110,7 +110,7 @@ type RestMethodConfig struct {
 	HeadersMap     map[int]string
 }
 
-// UnmarshalYAML ...
+// UnmarshalYAML unmarshals the RestMethodConfig by @unmarshal function
 func (c *RestMethodConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
 	if err := defaults.Set(c); err != nil {
 		return err
@@ -122,32 +122,32 @@ func (c *RestMethodConfig) UnmarshalYAML(unmarshal func(interface{}) error) erro
 	return nil
 }
 
-// GetRestConsumerServiceConfig ...
+// nolint
 func GetRestConsumerServiceConfig(path string) *RestServiceConfig {
 	return restConsumerServiceConfigMap[path]
 }
 
-// GetRestProviderServiceConfig ...
+// nolint
 func GetRestProviderServiceConfig(path string) *RestServiceConfig {
 	return restProviderServiceConfigMap[path]
 }
 
-// SetRestConsumerServiceConfigMap ...
+// nolint
 func SetRestConsumerServiceConfigMap(configMap map[string]*RestServiceConfig) {
 	restConsumerServiceConfigMap = configMap
 }
 
-// SetRestProviderServiceConfigMap ...
+// nolint
 func SetRestProviderServiceConfigMap(configMap map[string]*RestServiceConfig) {
 	restProviderServiceConfigMap = configMap
 }
 
-// GetRestConsumerServiceConfigMap ...
+// nolint
 func GetRestConsumerServiceConfigMap() map[string]*RestServiceConfig {
 	return restConsumerServiceConfigMap
 }
 
-// GetRestProviderServiceConfigMap ...
+// nolint
 func GetRestProviderServiceConfigMap() map[string]*RestServiceConfig {
 	return restProviderServiceConfigMap
 }
diff --git a/protocol/rest/rest_exporter.go b/protocol/rest/rest_exporter.go
index 1ee208615..e39558cae 100644
--- a/protocol/rest/rest_exporter.go
+++ b/protocol/rest/rest_exporter.go
@@ -28,16 +28,19 @@ import (
 	"github.com/apache/dubbo-go/protocol"
 )
 
+// nolint
 type RestExporter struct {
 	protocol.BaseExporter
 }
 
+// NewRestExporter returns a RestExporter
 func NewRestExporter(key string, invoker protocol.Invoker, exporterMap *sync.Map) *RestExporter {
 	return &RestExporter{
 		BaseExporter: *protocol.NewBaseExporter(key, invoker, exporterMap),
 	}
 }
 
+// Unexport unexport the RestExporter
 func (re *RestExporter) Unexport() {
 	serviceId := re.GetInvoker().GetUrl().GetParam(constant.BEAN_NAME_KEY, "")
 	interfaceName := re.GetInvoker().GetUrl().GetParam(constant.INTERFACE_KEY, "")
diff --git a/protocol/rest/rest_invoker.go b/protocol/rest/rest_invoker.go
index 121d1217e..691beeda4 100644
--- a/protocol/rest/rest_invoker.go
+++ b/protocol/rest/rest_invoker.go
@@ -35,12 +35,14 @@ import (
 	"github.com/apache/dubbo-go/protocol/rest/config"
 )
 
+// nolint
 type RestInvoker struct {
 	protocol.BaseInvoker
 	client              client.RestClient
 	restMethodConfigMap map[string]*config.RestMethodConfig
 }
 
+// NewRestInvoker returns a RestInvoker
 func NewRestInvoker(url common.URL, client *client.RestClient, restMethodConfig map[string]*config.RestMethodConfig) *RestInvoker {
 	return &RestInvoker{
 		BaseInvoker:         *protocol.NewBaseInvoker(url),
@@ -49,6 +51,7 @@ func NewRestInvoker(url common.URL, client *client.RestClient, restMethodConfig
 	}
 }
 
+// Invoke is used to call service method by invocation
 func (ri *RestInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
 	inv := invocation.(*invocation_impl.RPCInvocation)
 	methodConfig := ri.restMethodConfigMap[inv.MethodName()]
@@ -95,6 +98,7 @@ func (ri *RestInvoker) Invoke(ctx context.Context, invocation protocol.Invocatio
 	return &result
 }
 
+// restStringMapTransform is used to transform rest map
 func restStringMapTransform(paramsMap map[int]string, args []interface{}) (map[string]string, error) {
 	resMap := make(map[string]string, len(paramsMap))
 	for k, v := range paramsMap {
@@ -106,6 +110,7 @@ func restStringMapTransform(paramsMap map[int]string, args []interface{}) (map[s
 	return resMap, nil
 }
 
+// nolint
 func getRestHttpHeader(methodConfig *config.RestMethodConfig, args []interface{}) (http.Header, error) {
 	header := http.Header{}
 	headersMap := methodConfig.HeadersMap
diff --git a/protocol/rest/rest_protocol.go b/protocol/rest/rest_protocol.go
index e15eeb39d..0cd26c240 100644
--- a/protocol/rest/rest_protocol.go
+++ b/protocol/rest/rest_protocol.go
@@ -44,10 +44,12 @@ var (
 
 const REST = "rest"
 
+// nolint
 func init() {
 	extension.SetProtocol(REST, GetRestProtocol)
 }
 
+// nolint
 type RestProtocol struct {
 	protocol.BaseProtocol
 	serverLock sync.Mutex
@@ -56,6 +58,7 @@ type RestProtocol struct {
 	clientMap  map[client.RestOptions]client.RestClient
 }
 
+// NewRestProtocol returns a RestProtocol
 func NewRestProtocol() *RestProtocol {
 	return &RestProtocol{
 		BaseProtocol: protocol.NewBaseProtocol(),
@@ -64,6 +67,7 @@ func NewRestProtocol() *RestProtocol {
 	}
 }
 
+// Export export rest service
 func (rp *RestProtocol) Export(invoker protocol.Invoker) protocol.Exporter {
 	url := invoker.GetUrl()
 	serviceKey := url.ServiceKey()
@@ -81,6 +85,7 @@ func (rp *RestProtocol) Export(invoker protocol.Invoker) protocol.Exporter {
 	return exporter
 }
 
+// Refer create rest service reference
 func (rp *RestProtocol) Refer(url common.URL) protocol.Invoker {
 	// create rest_invoker
 	var requestTimeout = config.GetConsumerConfig().RequestTimeout
@@ -101,6 +106,7 @@ func (rp *RestProtocol) Refer(url common.URL) protocol.Invoker {
 	return invoker
 }
 
+// nolint
 func (rp *RestProtocol) getServer(url common.URL, serverType string) server.RestServer {
 	restServer, ok := rp.serverMap[url.Location]
 	if ok {
@@ -122,6 +128,7 @@ func (rp *RestProtocol) getServer(url common.URL, serverType string) server.Rest
 	return restServer
 }
 
+// nolint
 func (rp *RestProtocol) getClient(restOptions client.RestOptions, clientType string) client.RestClient {
 	restClient, ok := rp.clientMap[restOptions]
 	if ok {
@@ -138,6 +145,7 @@ func (rp *RestProtocol) getClient(restOptions client.RestOptions, clientType str
 	return restClient
 }
 
+// Destroy destroy rest service
 func (rp *RestProtocol) Destroy() {
 	// destroy rest_server
 	rp.BaseProtocol.Destroy()
@@ -150,6 +158,7 @@ func (rp *RestProtocol) Destroy() {
 	}
 }
 
+// GetRestProtocol get a rest protocol
 func GetRestProtocol() protocol.Protocol {
 	if restProtocol == nil {
 		restProtocol = NewRestProtocol()
diff --git a/registry/servicediscovery/synthesizer/subscribed_urls_synthesizer.go b/registry/servicediscovery/synthesizer/subscribed_urls_synthesizer.go
index 949a5822c..415ca35fb 100644
--- a/registry/servicediscovery/synthesizer/subscribed_urls_synthesizer.go
+++ b/registry/servicediscovery/synthesizer/subscribed_urls_synthesizer.go
@@ -22,6 +22,7 @@ import (
 	"github.com/apache/dubbo-go/registry"
 )
 
+// SubscribedURLsSynthesizer is used to synthesize the subscribed url
 type SubscribedURLsSynthesizer interface {
 	// Supports the synthesis of the subscribed url or not
 	Support(subscribedURL *common.URL) bool
diff --git a/remoting/listener.go b/remoting/listener.go
index 6cbb88318..eb27c71df 100644
--- a/remoting/listener.go
+++ b/remoting/listener.go
@@ -48,6 +48,7 @@ var serviceEventTypeStrings = [...]string{
 	"update",
 }
 
+// nolint
 func (t EventType) String() string {
 	return serviceEventTypeStrings[t]
 }
@@ -63,6 +64,7 @@ type Event struct {
 	Content string
 }
 
+// nolint
 func (e Event) String() string {
 	return fmt.Sprintf("Event{Action{%s}, Content{%s}}", e.Action, e.Content)
 }
-- 
GitLab