diff --git a/cluster/cluster_impl/available_cluster_invoker_test.go b/cluster/cluster_impl/available_cluster_invoker_test.go index 063100020a..948f2077b2 100644 --- a/cluster/cluster_impl/available_cluster_invoker_test.go +++ b/cluster/cluster_impl/available_cluster_invoker_test.go @@ -40,10 +40,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - availableUrl, _ = common.NewURL(fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", - constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var availableUrl, _ = common.NewURL(fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", + constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) func registerAvailable(invoker *mock.MockInvoker) protocol.Invoker { extension.SetLoadbalance("random", loadbalance.NewRandomLoadBalance) diff --git a/cluster/cluster_impl/base_cluster_invoker.go b/cluster/cluster_impl/base_cluster_invoker.go index 0d39bff13e..2df5f36b1d 100644 --- a/cluster/cluster_impl/base_cluster_invoker.go +++ b/cluster/cluster_impl/base_cluster_invoker.go @@ -56,7 +56,7 @@ func (invoker *baseClusterInvoker) GetUrl() *common.URL { } func (invoker *baseClusterInvoker) Destroy() { - //this is must atom operation + // this is must atom operation if invoker.destroyed.CAS(false, true) { invoker.directory.Destroy() } @@ -69,7 +69,7 @@ func (invoker *baseClusterInvoker) IsAvailable() bool { return invoker.directory.IsAvailable() } -//check invokers availables +// check invokers availables func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, invocation protocol.Invocation) error { if len(invokers) == 0 { ip := common.GetLocalIp() @@ -78,10 +78,9 @@ func (invoker *baseClusterInvoker) checkInvokers(invokers []protocol.Invoker, in invocation.MethodName(), invoker.directory.GetUrl().SubURL.Key(), invoker.directory.GetUrl().String(), ip, constant.Version) } return nil - } -//check cluster invoker is destroyed or not +// check cluster invoker is destroyed or not func (invoker *baseClusterInvoker) checkWhetherDestroyed() error { if invoker.destroyed.Load() { ip := common.GetLocalIp() @@ -99,7 +98,7 @@ func (invoker *baseClusterInvoker) doSelect(lb cluster.LoadBalance, invocation p url := invokers[0].GetUrl() sticky := url.GetParamBool(constant.STICKY_KEY, false) - //Get the service method sticky config if have + // Get the service method sticky config if have sticky = url.GetMethodParamBool(invocation.MethodName(), constant.STICKY_KEY, sticky) if invoker.stickyInvoker != nil && !isInvoked(invoker.stickyInvoker, invokers) { @@ -135,7 +134,7 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc selectedInvoker := lb.Select(invokers, invocation) - //judge if the selected Invoker is invoked and available + // judge if the selected Invoker is invoked and available if (!selectedInvoker.IsAvailable() && invoker.availablecheck) || isInvoked(selectedInvoker, invoked) { protocol.SetInvokerUnhealthyStatus(selectedInvoker) otherInvokers := getOtherInvokers(invokers, selectedInvoker) @@ -193,10 +192,10 @@ func getLoadBalance(invoker protocol.Invoker, invocation protocol.Invocation) cl url := invoker.GetUrl() methodName := invocation.MethodName() - //Get the service loadbalance config + // Get the service loadbalance config lb := url.GetParam(constant.LOADBALANCE_KEY, constant.DEFAULT_LOADBALANCE) - //Get the service method loadbalance config if have + // Get the service method loadbalance config if have if v := url.GetMethodParam(methodName, constant.LOADBALANCE_KEY, ""); len(v) > 0 { lb = v } diff --git a/cluster/cluster_impl/broadcast_cluster_invoker.go b/cluster/cluster_impl/broadcast_cluster_invoker.go index b117dbb246..52ae65c698 100644 --- a/cluster/cluster_impl/broadcast_cluster_invoker.go +++ b/cluster/cluster_impl/broadcast_cluster_invoker.go @@ -20,6 +20,7 @@ package cluster_impl import ( "context" ) + import ( "github.com/apache/dubbo-go/cluster" "github.com/apache/dubbo-go/common/logger" diff --git a/cluster/cluster_impl/broadcast_cluster_invoker_test.go b/cluster/cluster_impl/broadcast_cluster_invoker_test.go index 08d0002ee7..a654fb7a80 100644 --- a/cluster/cluster_impl/broadcast_cluster_invoker_test.go +++ b/cluster/cluster_impl/broadcast_cluster_invoker_test.go @@ -40,10 +40,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - broadcastUrl, _ = common.NewURL( - fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var broadcastUrl, _ = common.NewURL( + fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) func registerBroadcast(mockInvokers ...*mock.MockInvoker) protocol.Invoker { extension.SetLoadbalance("random", loadbalance.NewRandomLoadBalance) diff --git a/cluster/cluster_impl/failback_cluster_invoker.go b/cluster/cluster_impl/failback_cluster_invoker.go index 5e0d133a67..2ed1bae0d5 100644 --- a/cluster/cluster_impl/failback_cluster_invoker.go +++ b/cluster/cluster_impl/failback_cluster_invoker.go @@ -137,10 +137,10 @@ func (invoker *failbackClusterInvoker) Invoke(ctx context.Context, invocation pr return &protocol.RPCResult{} } - //Get the service loadbalance config + // Get the service loadbalance config url := invokers[0].GetUrl() lb := url.GetParam(constant.LOADBALANCE_KEY, constant.DEFAULT_LOADBALANCE) - //Get the service method loadbalance config if have + // Get the service method loadbalance config if have methodName := invocation.MethodName() if v := url.GetMethodParam(methodName, constant.LOADBALANCE_KEY, ""); v != "" { lb = v @@ -149,7 +149,7 @@ func (invoker *failbackClusterInvoker) Invoke(ctx context.Context, invocation pr loadBalance := extension.GetLoadbalance(lb) invoked := make([]protocol.Invoker, 0, len(invokers)) ivk := invoker.doSelect(loadBalance, invocation, invokers, invoked) - //DO INVOKE + // DO INVOKE result := ivk.Invoke(ctx, invocation) if result.Error() != nil { invoker.once.Do(func() { diff --git a/cluster/cluster_impl/failback_cluster_test.go b/cluster/cluster_impl/failback_cluster_test.go index d36e16e269..8fbd24f0e3 100644 --- a/cluster/cluster_impl/failback_cluster_test.go +++ b/cluster/cluster_impl/failback_cluster_test.go @@ -42,10 +42,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - failbackUrl, _ = common.NewURL( - fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var failbackUrl, _ = common.NewURL( + fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) // registerFailback register failbackCluster to cluster extension. func registerFailback(invoker *mock.MockInvoker) protocol.Invoker { diff --git a/cluster/cluster_impl/failfast_cluster_invoker.go b/cluster/cluster_impl/failfast_cluster_invoker.go index d71ef5f5a1..a7faa1b3b5 100644 --- a/cluster/cluster_impl/failfast_cluster_invoker.go +++ b/cluster/cluster_impl/failfast_cluster_invoker.go @@ -20,6 +20,7 @@ package cluster_impl import ( "context" ) + import ( "github.com/apache/dubbo-go/cluster" "github.com/apache/dubbo-go/protocol" diff --git a/cluster/cluster_impl/failfast_cluster_test.go b/cluster/cluster_impl/failfast_cluster_test.go index 9ac06b8d4a..6577c99123 100644 --- a/cluster/cluster_impl/failfast_cluster_test.go +++ b/cluster/cluster_impl/failfast_cluster_test.go @@ -40,10 +40,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - failfastUrl, _ = common.NewURL( - fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var failfastUrl, _ = common.NewURL( + fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) // registerFailfast register failfastCluster to cluster extension. func registerFailfast(invoker *mock.MockInvoker) protocol.Invoker { diff --git a/cluster/cluster_impl/failover_cluster_invoker.go b/cluster/cluster_impl/failover_cluster_invoker.go index ca490e7f8e..3d070c1c27 100644 --- a/cluster/cluster_impl/failover_cluster_invoker.go +++ b/cluster/cluster_impl/failover_cluster_invoker.go @@ -64,8 +64,8 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr loadBalance := getLoadBalance(invokers[0], invocation) for i := 0; i <= retries; i++ { - //Reselect before retry to avoid a change of candidate `invokers`. - //NOTE: if `invokers` changed, then `invoked` also lose accuracy. + // Reselect before retry to avoid a change of candidate `invokers`. + // NOTE: if `invokers` changed, then `invoked` also lose accuracy. if i > 0 { if err := invoker.checkWhetherDestroyed(); err != nil { return &protocol.RPCResult{Err: err} @@ -81,7 +81,7 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr continue } invoked = append(invoked, ivk) - //DO INVOKE + // DO INVOKE result = ivk.Invoke(ctx, invocation) if result.Error() != nil { providers = append(providers, ivk.GetUrl().Key()) @@ -105,7 +105,8 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr "Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. "+ "Last error is %+v.", methodName, invokerSvc, retries, providers, len(providers), len(invokers), invokerUrl, ip, constant.Version, result.Error().Error()), - )} + ), + } } func getRetries(invokers []protocol.Invoker, methodName string) int { @@ -114,9 +115,9 @@ func getRetries(invokers []protocol.Invoker, methodName string) int { } url := invokers[0].GetUrl() - //get reties + // get reties retriesConfig := url.GetParam(constant.RETRIES_KEY, constant.DEFAULT_RETRIES) - //Get the service method loadbalance config if have + // Get the service method loadbalance config if have if v := url.GetMethodParam(methodName, constant.RETRIES_KEY, ""); len(v) != 0 { retriesConfig = v } diff --git a/cluster/cluster_impl/failover_cluster_test.go b/cluster/cluster_impl/failover_cluster_test.go index 3ea6232d47..dd43e0ff8a 100644 --- a/cluster/cluster_impl/failover_cluster_test.go +++ b/cluster/cluster_impl/failover_cluster_test.go @@ -23,6 +23,7 @@ import ( "net/url" "testing" ) + import ( perrors "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cluster/cluster_impl/failsafe_cluster_invoker.go b/cluster/cluster_impl/failsafe_cluster_invoker.go index 27c59fff18..29d888475c 100644 --- a/cluster/cluster_impl/failsafe_cluster_invoker.go +++ b/cluster/cluster_impl/failsafe_cluster_invoker.go @@ -20,6 +20,7 @@ package cluster_impl import ( "context" ) + import ( "github.com/apache/dubbo-go/cluster" "github.com/apache/dubbo-go/common/constant" @@ -56,9 +57,9 @@ func (invoker *failsafeClusterInvoker) Invoke(ctx context.Context, invocation pr url := invokers[0].GetUrl() methodName := invocation.MethodName() - //Get the service loadbalance config + // Get the service loadbalance config lb := url.GetParam(constant.LOADBALANCE_KEY, constant.DEFAULT_LOADBALANCE) - //Get the service method loadbalance config if have + // Get the service method loadbalance config if have if v := url.GetMethodParam(methodName, constant.LOADBALANCE_KEY, ""); v != "" { lb = v } @@ -68,7 +69,7 @@ func (invoker *failsafeClusterInvoker) Invoke(ctx context.Context, invocation pr var result protocol.Result ivk := invoker.doSelect(loadbalance, invocation, invokers, invoked) - //DO INVOKE + // DO INVOKE result = ivk.Invoke(ctx, invocation) if result.Error() != nil { // ignore diff --git a/cluster/cluster_impl/failsafe_cluster_test.go b/cluster/cluster_impl/failsafe_cluster_test.go index 5e208bddde..95e114596a 100644 --- a/cluster/cluster_impl/failsafe_cluster_test.go +++ b/cluster/cluster_impl/failsafe_cluster_test.go @@ -40,10 +40,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - failsafeUrl, _ = common.NewURL( - fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var failsafeUrl, _ = common.NewURL( + fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) // registerFailsafe register failsafeCluster to cluster extension. func registerFailsafe(invoker *mock.MockInvoker) protocol.Invoker { diff --git a/cluster/cluster_impl/forking_cluster_test.go b/cluster/cluster_impl/forking_cluster_test.go index a2fa136d31..6549be57ac 100644 --- a/cluster/cluster_impl/forking_cluster_test.go +++ b/cluster/cluster_impl/forking_cluster_test.go @@ -42,10 +42,8 @@ import ( "github.com/apache/dubbo-go/protocol/mock" ) -var ( - forkingUrl, _ = common.NewURL( - fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) -) +var forkingUrl, _ = common.NewURL( + fmt.Sprintf("dubbo://%s:%d/com.ikurento.user.UserProvider", constant.LOCAL_HOST_VALUE, constant.DEFAULT_PORT)) func registerForking(mockInvokers ...*mock.MockInvoker) protocol.Invoker { extension.SetLoadbalance(loadbalance.RoundRobin, loadbalance.NewRoundRobinLoadBalance) @@ -72,7 +70,7 @@ func TestForkingInvokeSuccess(t *testing.T) { mockResult := &protocol.RPCResult{Rest: rest{tried: 0, success: true}} forkingUrl.AddParam(constant.FORKS_KEY, strconv.Itoa(3)) - //forkingUrl.AddParam(constant.TIMEOUT_KEY, strconv.Itoa(constant.DEFAULT_TIMEOUT)) + // forkingUrl.AddParam(constant.TIMEOUT_KEY, strconv.Itoa(constant.DEFAULT_TIMEOUT)) var wg sync.WaitGroup wg.Add(2) diff --git a/cluster/cluster_impl/zone_aware_cluster_invoker.go b/cluster/cluster_impl/zone_aware_cluster_invoker.go index 050f831f06..9834d87173 100644 --- a/cluster/cluster_impl/zone_aware_cluster_invoker.go +++ b/cluster/cluster_impl/zone_aware_cluster_invoker.go @@ -125,7 +125,6 @@ func (invoker *zoneAwareClusterInvoker) BeforeInvoker(ctx context.Context, invoc } func (invoker *zoneAwareClusterInvoker) AfterInvoker(ctx context.Context, invocation protocol.Invocation) { - } func matchParam(target, key, def string, invoker protocol.Invoker) bool { diff --git a/cluster/cluster_impl/zone_aware_cluster_invoker_test.go b/cluster/cluster_impl/zone_aware_cluster_invoker_test.go index 7f77f33166..d6817458a3 100644 --- a/cluster/cluster_impl/zone_aware_cluster_invoker_test.go +++ b/cluster/cluster_impl/zone_aware_cluster_invoker_test.go @@ -41,11 +41,12 @@ func TestZoneWareInvokerWithPreferredSuccess(t *testing.T) { ctrl := gomock.NewController(t) // In Go versions 1.14+, if you pass a *testing.T // into gomock.NewController(t) you no longer need to call ctrl.Finish(). - //defer ctrl.Finish() + // defer ctrl.Finish() mockResult := &protocol.RPCResult{ Attrs: map[string]interface{}{constant.PREFERRED_KEY: "true"}, - Rest: rest{tried: 0, success: true}} + Rest: rest{tried: 0, success: true}, + } var invokers []protocol.Invoker for i := 0; i < 2; i++ { @@ -82,7 +83,7 @@ func TestZoneWareInvokerWithWeightSuccess(t *testing.T) { ctrl := gomock.NewController(t) // In Go versions 1.14+, if you pass a *testing.T // into gomock.NewController(t) you no longer need to call ctrl.Finish(). - //defer ctrl.Finish() + // defer ctrl.Finish() w1 := "50" w2 := "200" @@ -100,7 +101,8 @@ func TestZoneWareInvokerWithWeightSuccess(t *testing.T) { func(invocation protocol.Invocation) protocol.Result { return &protocol.RPCResult{ Attrs: map[string]interface{}{constant.WEIGHT_KEY: w1}, - Rest: rest{tried: 0, success: true}} + Rest: rest{tried: 0, success: true}, + } }).MaxTimes(100) } else { url.SetParam(constant.REGISTRY_KEY+"."+constant.WEIGHT_KEY, w2) @@ -108,7 +110,8 @@ func TestZoneWareInvokerWithWeightSuccess(t *testing.T) { func(invocation protocol.Invocation) protocol.Result { return &protocol.RPCResult{ Attrs: map[string]interface{}{constant.WEIGHT_KEY: w2}, - Rest: rest{tried: 0, success: true}} + Rest: rest{tried: 0, success: true}, + } }).MaxTimes(100) } invokers = append(invokers, invoker) @@ -135,12 +138,12 @@ func TestZoneWareInvokerWithWeightSuccess(t *testing.T) { } func TestZoneWareInvokerWithZoneSuccess(t *testing.T) { - var zoneArray = []string{"hangzhou", "shanghai"} + zoneArray := []string{"hangzhou", "shanghai"} ctrl := gomock.NewController(t) // In Go versions 1.14+, if you pass a *testing.T // into gomock.NewController(t) you no longer need to call ctrl.Finish(). - //defer ctrl.Finish() + // defer ctrl.Finish() var invokers []protocol.Invoker for i := 0; i < 2; i++ { @@ -155,7 +158,8 @@ func TestZoneWareInvokerWithZoneSuccess(t *testing.T) { func(invocation protocol.Invocation) protocol.Result { return &protocol.RPCResult{ Attrs: map[string]interface{}{constant.ZONE_KEY: zoneValue}, - Rest: rest{tried: 0, success: true}} + Rest: rest{tried: 0, success: true}, + } }) invokers = append(invokers, invoker) } @@ -178,7 +182,7 @@ func TestZoneWareInvokerWithZoneForceFail(t *testing.T) { ctrl := gomock.NewController(t) // In Go versions 1.14+, if you pass a *testing.T // into gomock.NewController(t) you no longer need to call ctrl.Finish(). - //defer ctrl.Finish() + // defer ctrl.Finish() var invokers []protocol.Invoker for i := 0; i < 2; i++ { diff --git a/cluster/directory/base_directory_test.go b/cluster/directory/base_directory_test.go index 443f07de2c..9bbcac3ca7 100644 --- a/cluster/directory/base_directory_test.go +++ b/cluster/directory/base_directory_test.go @@ -47,7 +47,6 @@ func TestNewBaseDirectory(t *testing.T) { } func TestBuildRouterChain(t *testing.T) { - regURL := url regURL.AddParam(constant.INTERFACE_KEY, "mock-app") directory := NewBaseDirectory(regURL) diff --git a/cluster/directory/static_directory.go b/cluster/directory/static_directory.go index d9695d46b3..e184dc6af9 100644 --- a/cluster/directory/static_directory.go +++ b/cluster/directory/static_directory.go @@ -48,7 +48,7 @@ func NewStaticDirectory(invokers []protocol.Invoker) *staticDirectory { return dir } -//for-loop invokers ,if all invokers is available ,then it means directory is available +// for-loop invokers ,if all invokers is available ,then it means directory is available func (dir *staticDirectory) IsAvailable() bool { if len(dir.invokers) == 0 { return false diff --git a/cluster/loadbalance/consistent_hash.go b/cluster/loadbalance/consistent_hash.go index 3d036b4f3c..314728a0a1 100644 --- a/cluster/loadbalance/consistent_hash.go +++ b/cluster/loadbalance/consistent_hash.go @@ -27,9 +27,11 @@ import ( "strconv" "strings" ) + import ( gxsort "github.com/dubbogo/gost/sort" ) + import ( "github.com/apache/dubbo-go/cluster" "github.com/apache/dubbo-go/common/constant" @@ -56,8 +58,7 @@ func init() { } // ConsistentHashLoadBalance implementation of load balancing: using consistent hashing -type ConsistentHashLoadBalance struct { -} +type ConsistentHashLoadBalance struct{} // NewConsistentHashLoadBalance creates NewConsistentHashLoadBalance // diff --git a/cluster/loadbalance/least_active.go b/cluster/loadbalance/least_active.go index 87767359a9..f8fc015707 100644 --- a/cluster/loadbalance/least_active.go +++ b/cluster/loadbalance/least_active.go @@ -36,8 +36,7 @@ func init() { extension.SetLoadbalance(LeastActive, NewLeastActiveLoadBalance) } -type leastActiveLoadBalance struct { -} +type leastActiveLoadBalance struct{} // NewLeastActiveLoadBalance returns a least active load balance. // diff --git a/cluster/loadbalance/random.go b/cluster/loadbalance/random.go index cdde1b41fb..a2ae2bedb8 100644 --- a/cluster/loadbalance/random.go +++ b/cluster/loadbalance/random.go @@ -35,8 +35,7 @@ func init() { extension.SetLoadbalance(name, NewRandomLoadBalance) } -type randomLoadBalance struct { -} +type randomLoadBalance struct{} // NewRandomLoadBalance returns a random load balance instance. // diff --git a/cluster/loadbalance/round_robin.go b/cluster/loadbalance/round_robin.go index 51a76da998..f7653b619d 100644 --- a/cluster/loadbalance/round_robin.go +++ b/cluster/loadbalance/round_robin.go @@ -83,7 +83,7 @@ func (lb *roundRobinLoadBalance) Select(invokers []protocol.Invoker, invocation ) for _, invoker := range invokers { - var weight = GetWeight(invoker, invocation) + weight := GetWeight(invoker, invocation) if weight < 0 { weight = 0 } diff --git a/cluster/loadbalance/util.go b/cluster/loadbalance/util.go index 684ffe11a7..2dd55d3934 100644 --- a/cluster/loadbalance/util.go +++ b/cluster/loadbalance/util.go @@ -38,7 +38,7 @@ func GetWeight(invoker protocol.Invoker, invocation protocol.Invocation) int64 { weight = url.GetMethodParamInt64(invocation.MethodName(), constant.WEIGHT_KEY, constant.DEFAULT_WEIGHT) if weight > 0 { - //get service register time an do warm up time + // get service register time an do warm up time now := time.Now().Unix() timestamp := url.GetParamInt(constant.REMOTE_TIMESTAMP_KEY, now) if uptime := now - timestamp; uptime > 0 { diff --git a/cluster/router/condition/app_router_test.go b/cluster/router/condition/app_router_test.go index 86fdedea1f..6e072b6323 100644 --- a/cluster/router/condition/app_router_test.go +++ b/cluster/router/condition/app_router_test.go @@ -51,7 +51,6 @@ var ( ) func TestNewAppRouter(t *testing.T) { - testYML := `scope: application key: mock-app enabled: true @@ -105,7 +104,6 @@ conditions: } func TestGenerateConditions(t *testing.T) { - testYML := `scope: application key: mock-app enabled: true @@ -152,7 +150,6 @@ conditions: } func TestProcess(t *testing.T) { - testYML := `scope: application key: mock-app enabled: true diff --git a/cluster/router/condition/factory_test.go b/cluster/router/condition/factory_test.go index e08016d13e..7cd6fae783 100644 --- a/cluster/router/condition/factory_test.go +++ b/cluster/router/condition/factory_test.go @@ -204,7 +204,6 @@ func TestRoute_matchFilter(t *testing.T) { assert.Equal(t, 1, len(ret4.ToArray())) assert.Equal(t, 2, len(ret5.ToArray())) assert.Equal(t, 1, len(ret6.ToArray())) - } func TestRoute_methodRoute(t *testing.T) { @@ -232,7 +231,6 @@ func TestRoute_methodRoute(t *testing.T) { router3, _ := newConditionRouterFactory().NewPriorityRouter(getRouteUrl(rule3), notify) matchWhen = router3.(*ConditionRouter).MatchWhen(url3, inv) assert.Equal(t, true, matchWhen) - } func TestRoute_ReturnFalse(t *testing.T) { diff --git a/cluster/router/condition/listenable_router.go b/cluster/router/condition/listenable_router.go index 2e55b2075d..79d80da0d0 100644 --- a/cluster/router/condition/listenable_router.go +++ b/cluster/router/condition/listenable_router.go @@ -83,7 +83,8 @@ func newListenableRouter(url *common.URL, ruleKey string, notify chan struct{}) l.Process(&config_center.ConfigChangeEvent{ Key: routerKey, Value: rule, - ConfigType: remoting.EventTypeUpdate}) + ConfigType: remoting.EventTypeUpdate, + }) logger.Info("Init app router success") return l, nil diff --git a/cluster/router/condition/router.go b/cluster/router/condition/router.go index d543ca3f94..e1aef9879a 100644 --- a/cluster/router/condition/router.go +++ b/cluster/router/condition/router.go @@ -42,16 +42,12 @@ const ( pattern = `([&!=,]*)\\s*([^&!=,\\s]+)` ) -var ( - routerPatternReg = regexp.MustCompile(`([&!=,]*)\s*([^&!=,\s]+)`) -) +var routerPatternReg = regexp.MustCompile(`([&!=,]*)\s*([^&!=,\s]+)`) -var ( - emptyMatchPair = MatchPair{ - Matches: gxset.NewSet(), - Mismatches: gxset.NewSet(), - } -) +var emptyMatchPair = MatchPair{ + Matches: gxset.NewSet(), + Mismatches: gxset.NewSet(), +} // ConditionRouter Condition router struct type ConditionRouter struct { @@ -231,26 +227,26 @@ func parseRule(rule string) (map[string]MatchPair, error) { } case "=": if pair == emptyMatchPair { - var startIndex = getStartIndex(rule) + startIndex := getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } values = pair.Matches values.Add(content) case "!=": if pair == emptyMatchPair { - var startIndex = getStartIndex(rule) + startIndex := getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } values = pair.Mismatches values.Add(content) case ",": if values.Empty() { - var startIndex = getStartIndex(rule) + startIndex := getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } values.Add(content) default: - var startIndex = getStartIndex(rule) + startIndex := getStartIndex(rule) return nil, perrors.Errorf("Illegal route rule \"%s\", The error char '%s' at index %d before \"%d\".", rule, separator, startIndex, startIndex) } diff --git a/cluster/router/conncheck/conn_check_route_test.go b/cluster/router/conncheck/conn_check_route_test.go index fec733167f..360e97cb43 100644 --- a/cluster/router/conncheck/conn_check_route_test.go +++ b/cluster/router/conncheck/conn_check_route_test.go @@ -78,7 +78,6 @@ func TestConnCheckRouterRoute(t *testing.T) { res = hcr.Route(utils.ToBitmap(invokers), setUpAddrCache(hcr.(*ConnCheckRouter), invokers), consumerURL, inv) // now invoker3 invoker1 is healthy assert.True(t, len(res.ToArray()) == 2) - } func TestRecovery(t *testing.T) { diff --git a/cluster/router/conncheck/conn_health_check.go b/cluster/router/conncheck/conn_health_check.go index 9f05b0695f..a5cee10b13 100644 --- a/cluster/router/conncheck/conn_health_check.go +++ b/cluster/router/conncheck/conn_health_check.go @@ -30,8 +30,7 @@ func init() { } // DefaultConnChecker is the default implementation of ConnChecker, which determines the health status of invoker conn -type DefaultConnChecker struct { -} +type DefaultConnChecker struct{} // IsConnHealthy evaluates the healthy state on the given Invoker based on the number of successive bad request // and the current active request diff --git a/cluster/router/conncheck/factory.go b/cluster/router/conncheck/factory.go index a7b19aaea6..fb03689aaa 100644 --- a/cluster/router/conncheck/factory.go +++ b/cluster/router/conncheck/factory.go @@ -30,8 +30,7 @@ func init() { // ConnCheckRouteFactory is the factory to create conn check router, it aims at filter ip with unhealthy status // the unhealthy status is storied in protocol/rpc_status.go with sync.Map -type ConnCheckRouteFactory struct { -} +type ConnCheckRouteFactory struct{} // newConnCheckRouteFactory construct a new ConnCheckRouteFactory func newConnCheckRouteFactory() router.PriorityRouterFactory { diff --git a/cluster/router/healthcheck/default_health_check.go b/cluster/router/healthcheck/default_health_check.go index eb15e6f642..2c84d65faa 100644 --- a/cluster/router/healthcheck/default_health_check.go +++ b/cluster/router/healthcheck/default_health_check.go @@ -77,7 +77,6 @@ func (c *DefaultHealthChecker) getCircuitBreakerTimeout(status *protocol.RPCStat // getCircuitBreakerSleepWindowTime get the sleep window time of invoker, the unit is millisecond func (c *DefaultHealthChecker) getCircuitBreakerSleepWindowTime(status *protocol.RPCStatus) int64 { - successiveFailureCount := status.GetSuccessiveRequestFailureCount() diff := successiveFailureCount - c.GetRequestSuccessiveFailureThreshold() if diff < 0 { diff --git a/cluster/router/healthcheck/default_health_check_test.go b/cluster/router/healthcheck/default_health_check_test.go index c32a607889..4583dadba7 100644 --- a/cluster/router/healthcheck/default_health_check_test.go +++ b/cluster/router/healthcheck/default_health_check_test.go @@ -123,7 +123,6 @@ func TestDefaultHealthCheckerGetCircuitBreakerTimeout(t *testing.T) { timeout = defaultHc.getCircuitBreakerTimeout(protocol.GetURLStatus(url1)) // timeout must after the current time assert.True(t, timeout > protocol.CurrentTimeMillis()) - } func TestDefaultHealthCheckerIsCircuitBreakerTripped(t *testing.T) { @@ -139,7 +138,6 @@ func TestDefaultHealthCheckerIsCircuitBreakerTripped(t *testing.T) { } tripped = defaultHc.isCircuitBreakerTripped(protocol.GetURLStatus(url)) assert.True(t, tripped) - } func TestNewDefaultHealthChecker(t *testing.T) { diff --git a/cluster/router/healthcheck/factory.go b/cluster/router/healthcheck/factory.go index a9054c7714..e6d876db3f 100644 --- a/cluster/router/healthcheck/factory.go +++ b/cluster/router/healthcheck/factory.go @@ -29,8 +29,7 @@ func init() { } // HealthCheckRouteFactory -type HealthCheckRouteFactory struct { -} +type HealthCheckRouteFactory struct{} // newHealthCheckRouteFactory construct a new HealthCheckRouteFactory func newHealthCheckRouteFactory() router.PriorityRouterFactory { diff --git a/cluster/router/healthcheck/health_check_route_test.go b/cluster/router/healthcheck/health_check_route_test.go index f499c85c09..5422c53a11 100644 --- a/cluster/router/healthcheck/health_check_route_test.go +++ b/cluster/router/healthcheck/health_check_route_test.go @@ -112,7 +112,6 @@ func TestHealthCheckRouterRoute(t *testing.T) { // invoker1 go to healthy again after 2s res = hcr.Route(utils.ToBitmap(invokers), setUpAddrCache(hcr.(*HealthCheckRouter), invokers), consumerURL, inv) assert.True(t, res.Contains(0)) - } func TestNewHealthCheckRouter(t *testing.T) { diff --git a/cluster/router/local/factory.go b/cluster/router/local/factory.go index 42e03e25ab..711a9ea1d6 100644 --- a/cluster/router/local/factory.go +++ b/cluster/router/local/factory.go @@ -29,8 +29,7 @@ func init() { } // LocalPriorityRouteFactory -type LocalPriorityRouteFactory struct { -} +type LocalPriorityRouteFactory struct{} // newLocalPriorityRouteFactory construct a new LocalDiscRouteFactory func newLocalPriorityRouteFactory() router.PriorityRouterFactory { diff --git a/cluster/router/local/self_priority_route.go b/cluster/router/local/self_priority_route.go index 87eaaf7837..7fd188cd82 100644 --- a/cluster/router/local/self_priority_route.go +++ b/cluster/router/local/self_priority_route.go @@ -80,7 +80,7 @@ func (r *LocalPriorityRouter) Pool(invokers []protocol.Invoker) (router.AddrPool logger.Debug("found local ip ") return rb, nil } - for i, _ := range invokers { + for i := range invokers { rb[localPriority].Add(uint32(i)) } return rb, nil diff --git a/cluster/router/tag/file.go b/cluster/router/tag/file.go index 81c25109dd..8977ddce0d 100644 --- a/cluster/router/tag/file.go +++ b/cluster/router/tag/file.go @@ -41,7 +41,7 @@ type FileTagRouter struct { router *tagRouter routerRule *RouterRule url *common.URL - //force bool + // force bool } // NewFileTagRouter Create file tag router instance with content (from config file) diff --git a/cluster/router/tag/file_test.go b/cluster/router/tag/file_test.go index 513ba0c0b6..1866ec057c 100644 --- a/cluster/router/tag/file_test.go +++ b/cluster/router/tag/file_test.go @@ -52,7 +52,6 @@ func TestFileTagRouterURL(t *testing.T) { priority := url.GetParam(constant.RouterPriority, "0") assert.Equal(t, "true", force) assert.Equal(t, "100", priority) - } func TestFileTagRouterPriority(t *testing.T) { diff --git a/cluster/router/tag/router_rule.go b/cluster/router/tag/router_rule.go index 512d8f1079..1259c42ce3 100644 --- a/cluster/router/tag/router_rule.go +++ b/cluster/router/tag/router_rule.go @@ -69,7 +69,7 @@ func (t *RouterRule) parseTags() { } func (t *RouterRule) getAddresses() []string { - var result = make([]string, 0, 2*len(t.Tags)) + result := make([]string, 0, 2*len(t.Tags)) for _, tag := range t.Tags { result = append(result, tag.Addresses...) } @@ -77,7 +77,7 @@ func (t *RouterRule) getAddresses() []string { } func (t *RouterRule) getTagNames() []string { - var result = make([]string, 0, len(t.Tags)) + result := make([]string, 0, len(t.Tags)) for _, tag := range t.Tags { result = append(result, tag.Name) } diff --git a/cluster/router/tag/tag_router.go b/cluster/router/tag/tag_router.go index 3d0393a487..e0522d41c4 100644 --- a/cluster/router/tag/tag_router.go +++ b/cluster/router/tag/tag_router.go @@ -53,7 +53,7 @@ type addrMetadata struct { // application name application string // is rule a runtime rule - //ruleRuntime bool + // ruleRuntime bool // is rule a force rule ruleForce bool // is rule a valid rule @@ -267,7 +267,8 @@ func (c *tagRouter) fetchRuleIfNecessary(invokers []protocol.Invoker) { c.Process(&config_center.ConfigChangeEvent{ Key: routerKey, Value: rule, - ConfigType: remoting.EventTypeUpdate}) + ConfigType: remoting.EventTypeUpdate, + }) } } diff --git a/cluster/router/tag/tag_router_test.go b/cluster/router/tag/tag_router_test.go index 3b53d473fa..e5abf4e1ea 100644 --- a/cluster/router/tag/tag_router_test.go +++ b/cluster/router/tag/tag_router_test.go @@ -72,9 +72,7 @@ const ( routerZk = "zookeeper" ) -var ( - zkFormat = "zookeeper://%s:%d" -) +var zkFormat = "zookeeper://%s:%d" // MockInvoker is only mock the Invoker to support test tagRouter type MockInvoker struct { @@ -257,7 +255,7 @@ func TestRouteBeijingInvoker(t *testing.T) { type DynamicTagRouter struct { suite.Suite - //rule *RouterRule + // rule *RouterRule route *tagRouter zkClient *gxzookeeper.ZookeeperClient diff --git a/common/config/environment.go b/common/config/environment.go index 23baa702c7..c568646cc0 100644 --- a/common/config/environment.go +++ b/common/config/environment.go @@ -35,7 +35,7 @@ import ( // But for add these features in future ,I finish the environment struct following Environment class in java. type Environment struct { configCenterFirst bool - //externalConfigs sync.Map + // externalConfigs sync.Map externalConfigMap sync.Map appExternalConfigMap sync.Map dynamicConfiguration config_center.DynamicConfiguration diff --git a/common/constant/default.go b/common/constant/default.go index bbe022cb2e..f52a3f03f5 100644 --- a/common/constant/default.go +++ b/common/constant/default.go @@ -20,7 +20,7 @@ package constant const ( DUBBO = "dubbo" PROVIDER_PROTOCOL = "provider" - //compatible with 2.6.x + // compatible with 2.6.x OVERRIDE_PROTOCOL = "override" EMPTY_PROTOCOL = "empty" ROUTER_PROTOCOL = "router" @@ -87,3 +87,10 @@ const ( const ( SERVICE_DISCOVERY_DEFAULT_GROUP = "DEFAULT_GROUP" ) + +const ( + DEFAULT_PROVIDER_CONF_FILE_PATH = "../profiles/dev/server.yml" + DEFAULT_CONSUMER_CONF_FILE_PATH = "../profiles/dev/client.yml" + DEFAULT_LOG_CONF_FILE_PATH = "../profiles/dev/log.yml" + DEFAULT_ROUTER_CONF_FILE_PATH = "../profiles/dev/router.yml" +) diff --git a/common/constant/key.go b/common/constant/key.go index 4b867d8d0c..62a8fccf6c 100644 --- a/common/constant/key.go +++ b/common/constant/key.go @@ -49,7 +49,7 @@ const ( PORT_KEY = "port" PROTOCOL_KEY = "protocol" PATH_SEPARATOR = "/" - //DUBBO_KEY = "dubbo" + // DUBBO_KEY = "dubbo" SSL_ENABLED_KEY = "ssl-enabled" ) @@ -144,6 +144,7 @@ const ( CONFIG_VERSION_KEY = "configVersion" COMPATIBLE_CONFIG_KEY = "compatible_config" ) + const ( RegistryConfigPrefix = "dubbo.registries." SingleRegistryConfigPrefix = "dubbo.registry." diff --git a/common/constant/time.go b/common/constant/time.go index 3bb339229b..d50990cfbc 100644 --- a/common/constant/time.go +++ b/common/constant/time.go @@ -21,8 +21,6 @@ import ( "time" ) -var ( - // The value will be 10^6 - // 1ms = 10^6ns - MsToNanoRate = int64(time.Millisecond / time.Nanosecond) -) +// The value will be 10^6 +// 1ms = 10^6ns +var MsToNanoRate = int64(time.Millisecond / time.Nanosecond) diff --git a/common/extension/cluster.go b/common/extension/cluster.go index 8be27a1ca3..1f6ab102e5 100644 --- a/common/extension/cluster.go +++ b/common/extension/cluster.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/cluster" ) -var ( - clusters = make(map[string]func() cluster.Cluster) -) +var clusters = make(map[string]func() cluster.Cluster) // SetCluster sets the cluster fault-tolerant mode with @name // For example: available/failfast/broadcast/failfast/failsafe/... diff --git a/common/extension/config_center.go b/common/extension/config_center.go index 5a2c52f32d..9c616d3dc0 100644 --- a/common/extension/config_center.go +++ b/common/extension/config_center.go @@ -22,9 +22,7 @@ import ( "github.com/apache/dubbo-go/config_center" ) -var ( - configCenters = make(map[string]func(config *common.URL) (config_center.DynamicConfiguration, error)) -) +var configCenters = make(map[string]func(config *common.URL) (config_center.DynamicConfiguration, error)) // SetConfigCenter sets the DynamicConfiguration with @name func SetConfigCenter(name string, v func(*common.URL) (config_center.DynamicConfiguration, error)) { @@ -37,5 +35,4 @@ func GetConfigCenter(name string, config *common.URL) (config_center.DynamicConf panic("config center for " + name + " is not existing, make sure you have import the package.") } return configCenters[name](config) - } diff --git a/common/extension/config_center_factory.go b/common/extension/config_center_factory.go index dff8975229..9d3f0d9321 100644 --- a/common/extension/config_center_factory.go +++ b/common/extension/config_center_factory.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/config_center" ) -var ( - configCenterFactories = make(map[string]func() config_center.DynamicConfigurationFactory) -) +var configCenterFactories = make(map[string]func() config_center.DynamicConfigurationFactory) // SetConfigCenterFactory sets the DynamicConfigurationFactory with @name func SetConfigCenterFactory(name string, v func() config_center.DynamicConfigurationFactory) { diff --git a/common/extension/config_post_processor.go b/common/extension/config_post_processor.go index db126b744d..19a479e8ae 100644 --- a/common/extension/config_post_processor.go +++ b/common/extension/config_post_processor.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/config/interfaces" ) -var ( - processors = make(map[string]interfaces.ConfigPostProcessor) -) +var processors = make(map[string]interfaces.ConfigPostProcessor) // SetConfigPostProcessor registers a ConfigPostProcessor with the given name. func SetConfigPostProcessor(name string, processor interfaces.ConfigPostProcessor) { diff --git a/common/extension/configurator.go b/common/extension/configurator.go index dc2bea73af..3cc7ffc2e1 100644 --- a/common/extension/configurator.go +++ b/common/extension/configurator.go @@ -29,9 +29,7 @@ const ( type getConfiguratorFunc func(url *common.URL) config_center.Configurator -var ( - configurator = make(map[string]getConfiguratorFunc) -) +var configurator = make(map[string]getConfiguratorFunc) // SetConfigurator sets the getConfiguratorFunc with @name func SetConfigurator(name string, v getConfiguratorFunc) { @@ -44,7 +42,6 @@ func GetConfigurator(name string, url *common.URL) config_center.Configurator { panic("configurator for " + name + " is not existing, make sure you have import the package.") } return configurator[name](url) - } // SetDefaultConfigurator sets the default Configurator @@ -58,7 +55,6 @@ func GetDefaultConfigurator(url *common.URL) config_center.Configurator { panic("configurator for default is not existing, make sure you have import the package.") } return configurator[DefaultKey](url) - } // GetDefaultConfiguratorFunc gets default configurator function diff --git a/common/extension/conn_checker.go b/common/extension/conn_checker.go index fbd9e34b23..38659d75ad 100644 --- a/common/extension/conn_checker.go +++ b/common/extension/conn_checker.go @@ -22,9 +22,7 @@ import ( "github.com/apache/dubbo-go/common" ) -var ( - connCheckers = make(map[string]func(url *common.URL) router.ConnChecker) -) +var connCheckers = make(map[string]func(url *common.URL) router.ConnChecker) // SetHealthChecker sets the HealthChecker with @name func SetConnChecker(name string, fcn func(_ *common.URL) router.ConnChecker) { diff --git a/common/extension/event_dispatcher.go b/common/extension/event_dispatcher.go index f0503e0542..3504d9b6b8 100644 --- a/common/extension/event_dispatcher.go +++ b/common/extension/event_dispatcher.go @@ -32,9 +32,7 @@ var ( initEventOnce sync.Once ) -var ( - dispatchers = make(map[string]func() observer.EventDispatcher, 8) -) +var dispatchers = make(map[string]func() observer.EventDispatcher, 8) // SetEventDispatcher, actually, it doesn't really init the global dispatcher func SetEventDispatcher(name string, v func() observer.EventDispatcher) { diff --git a/common/extension/event_dispatcher_test.go b/common/extension/event_dispatcher_test.go index 472360cea5..fbcf45250a 100644 --- a/common/extension/event_dispatcher_test.go +++ b/common/extension/event_dispatcher_test.go @@ -25,6 +25,7 @@ import ( import ( "github.com/stretchr/testify/assert" ) + import ( "github.com/apache/dubbo-go/common/observer" ) @@ -64,8 +65,7 @@ func TestAddEventListener(t *testing.T) { assert.Equal(t, 2, len(initEventListeners)) } -type mockEventListener struct { -} +type mockEventListener struct{} func (m mockEventListener) GetPriority() int { panic("implement me") @@ -79,8 +79,7 @@ func (m mockEventListener) GetEventType() reflect.Type { panic("implement me") } -type mockEventDispatcher struct { -} +type mockEventDispatcher struct{} func (m mockEventDispatcher) AddEventListener(listener observer.EventListener) { panic("implement me") diff --git a/common/extension/graceful_shutdown.go b/common/extension/graceful_shutdown.go index cb55419aab..8c98192b5a 100644 --- a/common/extension/graceful_shutdown.go +++ b/common/extension/graceful_shutdown.go @@ -21,9 +21,7 @@ import ( "container/list" ) -var ( - customShutdownCallbacks = list.New() -) +var customShutdownCallbacks = list.New() /** * AddCustomShutdownCallback diff --git a/common/extension/health_checker.go b/common/extension/health_checker.go index cec4c2defc..c0cc0f636b 100644 --- a/common/extension/health_checker.go +++ b/common/extension/health_checker.go @@ -22,9 +22,7 @@ import ( "github.com/apache/dubbo-go/common" ) -var ( - healthCheckers = make(map[string]func(url *common.URL) router.HealthChecker) -) +var healthCheckers = make(map[string]func(url *common.URL) router.HealthChecker) // SetHealthChecker sets the HealthChecker with @name func SetHealthChecker(name string, fcn func(_ *common.URL) router.HealthChecker) { diff --git a/common/extension/health_checker_test.go b/common/extension/health_checker_test.go index af6b114a61..cee12ced93 100644 --- a/common/extension/health_checker_test.go +++ b/common/extension/health_checker_test.go @@ -37,8 +37,7 @@ func TestGetHealthChecker(t *testing.T) { assert.NotNil(t, checker) } -type mockHealthChecker struct { -} +type mockHealthChecker struct{} func (m mockHealthChecker) IsHealthy(invoker protocol.Invoker) bool { return true diff --git a/common/extension/loadbalance.go b/common/extension/loadbalance.go index aa19141014..bbd0fbc3fe 100644 --- a/common/extension/loadbalance.go +++ b/common/extension/loadbalance.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/cluster" ) -var ( - loadbalances = make(map[string]func() cluster.LoadBalance) -) +var loadbalances = make(map[string]func() cluster.LoadBalance) // SetLoadbalance sets the loadbalance extension with @name // For example: random/round_robin/consistent_hash/least_active/... diff --git a/common/extension/metadata_report_factory.go b/common/extension/metadata_report_factory.go index 593318d01b..641ba4a433 100644 --- a/common/extension/metadata_report_factory.go +++ b/common/extension/metadata_report_factory.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/metadata/report/factory" ) -var ( - metaDataReportFactories = make(map[string]func() factory.MetadataReportFactory, 8) -) +var metaDataReportFactories = make(map[string]func() factory.MetadataReportFactory, 8) // SetMetadataReportFactory sets the MetadataReportFactory with @name func SetMetadataReportFactory(name string, v func() factory.MetadataReportFactory) { diff --git a/common/extension/metadata_service_proxy_factory.go b/common/extension/metadata_service_proxy_factory.go index 2b88d37c9a..3e05c2257f 100644 --- a/common/extension/metadata_service_proxy_factory.go +++ b/common/extension/metadata_service_proxy_factory.go @@ -25,9 +25,7 @@ import ( "github.com/apache/dubbo-go/metadata/service" ) -var ( - metadataServiceProxyFactoryMap = make(map[string]func() service.MetadataServiceProxyFactory, 2) -) +var metadataServiceProxyFactoryMap = make(map[string]func() service.MetadataServiceProxyFactory, 2) type MetadataServiceProxyFactoryFunc func() service.MetadataServiceProxyFactory diff --git a/common/extension/metrics.go b/common/extension/metrics.go index 60cf6bac23..3e221b7ab7 100644 --- a/common/extension/metrics.go +++ b/common/extension/metrics.go @@ -21,11 +21,9 @@ import ( "github.com/apache/dubbo-go/metrics" ) -var ( - // we couldn't store the instance because the some instance may initialize before loading configuration - // so lazy initialization will be better. - metricReporterMap = make(map[string]func() metrics.Reporter, 4) -) +// we couldn't store the instance because the some instance may initialize before loading configuration +// so lazy initialization will be better. +var metricReporterMap = make(map[string]func() metrics.Reporter, 4) // SetMetricReporter sets a reporter with the @name func SetMetricReporter(name string, reporterFunc func() metrics.Reporter) { diff --git a/common/extension/metrics_test.go b/common/extension/metrics_test.go index 2aaae75f0c..bcd86a8950 100644 --- a/common/extension/metrics_test.go +++ b/common/extension/metrics_test.go @@ -42,8 +42,7 @@ func TestGetMetricReporter(t *testing.T) { assert.Equal(t, reporter, res) } -type mockReporter struct { -} +type mockReporter struct{} // Report method for feature expansion func (m mockReporter) Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) { diff --git a/common/extension/protocol.go b/common/extension/protocol.go index c89dd08fae..0c77ead644 100644 --- a/common/extension/protocol.go +++ b/common/extension/protocol.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/protocol" ) -var ( - protocols = make(map[string]func() protocol.Protocol) -) +var protocols = make(map[string]func() protocol.Protocol) // SetProtocol sets the protocol extension with @name func SetProtocol(name string, v func() protocol.Protocol) { diff --git a/common/extension/proxy_factory.go b/common/extension/proxy_factory.go index 1e326d884b..414905f039 100644 --- a/common/extension/proxy_factory.go +++ b/common/extension/proxy_factory.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/common/proxy" ) -var ( - proxyFactories = make(map[string]func(...proxy.Option) proxy.ProxyFactory) -) +var proxyFactories = make(map[string]func(...proxy.Option) proxy.ProxyFactory) // SetProxyFactory sets the ProxyFactory extension with @name func SetProxyFactory(name string, f func(...proxy.Option) proxy.ProxyFactory) { diff --git a/common/extension/registry.go b/common/extension/registry.go index 187c8fecf4..411ee37911 100644 --- a/common/extension/registry.go +++ b/common/extension/registry.go @@ -22,9 +22,7 @@ import ( "github.com/apache/dubbo-go/registry" ) -var ( - registrys = make(map[string]func(config *common.URL) (registry.Registry, error)) -) +var registrys = make(map[string]func(config *common.URL) (registry.Registry, error)) // SetRegistry sets the registry extension with @name func SetRegistry(name string, v func(_ *common.URL) (registry.Registry, error)) { @@ -37,5 +35,4 @@ func GetRegistry(name string, config *common.URL) (registry.Registry, error) { panic("registry for " + name + " does not exist. please make sure that you have imported the package `github.com/apache/dubbo-go/registry/" + name + "`.") } return registrys[name](config) - } diff --git a/common/extension/rest_client.go b/common/extension/rest_client.go index 0c2f4ddf95..be60d28470 100644 --- a/common/extension/rest_client.go +++ b/common/extension/rest_client.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/protocol/rest/client" ) -var ( - restClients = make(map[string]func(restOptions *client.RestOptions) client.RestClient, 8) -) +var restClients = make(map[string]func(restOptions *client.RestOptions) client.RestClient, 8) // SetRestClient sets the RestClient with @name func SetRestClient(name string, fun func(_ *client.RestOptions) client.RestClient) { diff --git a/common/extension/rest_server.go b/common/extension/rest_server.go index 37a231a57c..c055309d92 100644 --- a/common/extension/rest_server.go +++ b/common/extension/rest_server.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/protocol/rest/server" ) -var ( - restServers = make(map[string]func() server.RestServer, 8) -) +var restServers = make(map[string]func() server.RestServer, 8) // SetRestServer sets the RestServer with @name func SetRestServer(name string, fun func() server.RestServer) { diff --git a/common/extension/service_discovery.go b/common/extension/service_discovery.go index 0227920dc6..6a691e1aa5 100644 --- a/common/extension/service_discovery.go +++ b/common/extension/service_discovery.go @@ -20,13 +20,12 @@ package extension import ( perrors "github.com/pkg/errors" ) + import ( "github.com/apache/dubbo-go/registry" ) -var ( - discoveryCreatorMap = make(map[string]func(name string) (registry.ServiceDiscovery, error), 4) -) +var discoveryCreatorMap = make(map[string]func(name string) (registry.ServiceDiscovery, error), 4) // SetServiceDiscovery will store the @creator and @name // protocol indicate the implementation, like nacos diff --git a/common/extension/service_instance_customizer.go b/common/extension/service_instance_customizer.go index 3ebb3e40f5..3ec6af15b1 100644 --- a/common/extension/service_instance_customizer.go +++ b/common/extension/service_instance_customizer.go @@ -25,9 +25,7 @@ import ( "github.com/apache/dubbo-go/registry" ) -var ( - customizers = make([]registry.ServiceInstanceCustomizer, 0, 8) -) +var customizers = make([]registry.ServiceInstanceCustomizer, 0, 8) // AddCustomizers will put the customizer into slices and then sort them; // this method will be invoked several time, so we sort them here. diff --git a/common/extension/service_instance_selector_factory.go b/common/extension/service_instance_selector_factory.go index 66d3e7646e..9d107c40f6 100644 --- a/common/extension/service_instance_selector_factory.go +++ b/common/extension/service_instance_selector_factory.go @@ -25,9 +25,7 @@ import ( "github.com/apache/dubbo-go/registry/servicediscovery/instance" ) -var ( - serviceInstanceSelectorMappings = make(map[string]func() instance.ServiceInstanceSelector, 2) -) +var serviceInstanceSelectorMappings = make(map[string]func() instance.ServiceInstanceSelector, 2) // nolint func SetServiceInstanceSelector(name string, f func() instance.ServiceInstanceSelector) { diff --git a/common/extension/service_name_mapping.go b/common/extension/service_name_mapping.go index 99fd4c25e9..317acf6b8c 100644 --- a/common/extension/service_name_mapping.go +++ b/common/extension/service_name_mapping.go @@ -23,9 +23,7 @@ import ( type ServiceNameMappingCreator func() mapping.ServiceNameMapping -var ( - globalNameMappingCreator ServiceNameMappingCreator -) +var globalNameMappingCreator ServiceNameMappingCreator func SetGlobalServiceNameMapping(nameMappingCreator ServiceNameMappingCreator) { globalNameMappingCreator = nameMappingCreator diff --git a/common/logger/logger.go b/common/logger/logger.go index 8519543c6a..bc01043ff5 100644 --- a/common/logger/logger.go +++ b/common/logger/logger.go @@ -37,9 +37,7 @@ import ( "github.com/apache/dubbo-go/common/constant" ) -var ( - logger Logger -) +var logger Logger // nolint type DubboLogger struct { @@ -72,6 +70,9 @@ func init() { for len(fs.Args()) != 0 { fs.Parse(fs.Args()[1:]) } + if *logConfFile == "" { + *logConfFile = constant.DEFAULT_LOG_CONF_FILE_PATH + } err := InitLog(*logConfFile) if err != nil { log.Printf("[InitLog] warn: %v", err) diff --git a/common/observer/dispatcher/mock_event_dispatcher.go b/common/observer/dispatcher/mock_event_dispatcher.go index 45cdaa71a2..012f5ba5ae 100644 --- a/common/observer/dispatcher/mock_event_dispatcher.go +++ b/common/observer/dispatcher/mock_event_dispatcher.go @@ -25,8 +25,7 @@ import ( // It is only used by tests // Now the implementation doing nothing, // But you can modify this if needed -type MockEventDispatcher struct { -} +type MockEventDispatcher struct{} // AddEventListener do nothing func (m MockEventDispatcher) AddEventListener(listener observer.EventListener) { diff --git a/common/observer/listenable_test.go b/common/observer/listenable_test.go index 5a03382a93..3ae6e5eb30 100644 --- a/common/observer/listenable_test.go +++ b/common/observer/listenable_test.go @@ -41,7 +41,6 @@ func TestListenable(t *testing.T) { ts = append(ts, el) b.AddEventListeners(ts) assert.Equal(t, len(al), 1) - } type TestEvent struct { diff --git a/common/proxy/proxy.go b/common/proxy/proxy.go index fd3481021c..68d37b737b 100644 --- a/common/proxy/proxy.go +++ b/common/proxy/proxy.go @@ -53,9 +53,7 @@ type ( ImplementFunc func(p *Proxy, v common.RPCService) ) -var ( - typError = reflect.Zero(reflect.TypeOf((*error)(nil)).Elem()).Type() -) +var typError = reflect.Zero(reflect.TypeOf((*error)(nil)).Elem()).Type() // NewProxy create service proxy. func NewProxy(invoke protocol.Invoker, callback interface{}, attachments map[string]string) *Proxy { @@ -251,7 +249,7 @@ func DefaultProxyImplementFunc(p *Proxy, v common.RPCService) { continue } - var funcOuts = make([]reflect.Type, outNum) + funcOuts := make([]reflect.Type, outNum) for i := 0; i < outNum; i++ { funcOuts[i] = t.Type.Out(i) } @@ -261,5 +259,4 @@ func DefaultProxyImplementFunc(p *Proxy, v common.RPCService) { logger.Debugf("set method [%s]", methodName) } } - } diff --git a/common/proxy/proxy_factory/default.go b/common/proxy/proxy_factory/default.go index ff3d7955a0..4ef828f0ee 100644 --- a/common/proxy/proxy_factory/default.go +++ b/common/proxy/proxy_factory/default.go @@ -41,11 +41,10 @@ func init() { } // DefaultProxyFactory is the default proxy factory -type DefaultProxyFactory struct { - //delegate ProxyFactory +type DefaultProxyFactory struct { // delegate ProxyFactory } -//you can rewrite DefaultProxyFactory in extension and delegate the default proxy factory like below +// you can rewrite DefaultProxyFactory in extension and delegate the default proxy factory like below //func WithDelegate(delegateProxyFactory ProxyFactory) Option { // return func(proxy ProxyFactory) { @@ -65,7 +64,7 @@ func (factory *DefaultProxyFactory) GetProxy(invoker protocol.Invoker, url *comm // GetAsyncProxy gets a async proxy func (factory *DefaultProxyFactory) GetAsyncProxy(invoker protocol.Invoker, callBack interface{}, url *common.URL) *proxy.Proxy { - //create proxy + // create proxy attachments := map[string]string{} attachments[constant.ASYNC_KEY] = url.GetParam(constant.ASYNC_KEY, "false") return proxy.NewProxy(invoker, callBack, attachments) @@ -88,7 +87,7 @@ func (pi *ProxyInvoker) Invoke(ctx context.Context, invocation protocol.Invocati result := &protocol.RPCResult{} result.SetAttachments(invocation.Attachments()) - //get providerUrl. The origin url may be is registry URL. + // get providerUrl. The origin url may be is registry URL. url := getProviderURL(pi.GetUrl()) methodName := invocation.MethodName() diff --git a/common/proxy/proxy_factory/default_test.go b/common/proxy/proxy_factory/default_test.go index 4002ab9584..6a8c29a361 100644 --- a/common/proxy/proxy_factory/default_test.go +++ b/common/proxy/proxy_factory/default_test.go @@ -38,8 +38,7 @@ func TestGetProxy(t *testing.T) { assert.NotNil(t, proxy) } -type TestAsync struct { -} +type TestAsync struct{} func (u *TestAsync) CallBack(res common.CallbackResponse) { fmt.Println("CallBack res:", res) diff --git a/common/proxy/proxy_test.go b/common/proxy/proxy_test.go index c335bf6783..86b3b61b65 100644 --- a/common/proxy/proxy_test.go +++ b/common/proxy/proxy_test.go @@ -58,7 +58,6 @@ func (s *TestServiceInt) Reference() string { } func TestProxyImplement(t *testing.T) { - invoker := protocol.NewBaseInvoker(&common.URL{}) p := NewProxy(invoker, nil, map[string]string{constant.ASYNC_KEY: "false"}) s := &TestService{} @@ -122,7 +121,6 @@ func TestProxyImplement(t *testing.T) { s3 := &S3{TestService: *s} p.Implement(s3) assert.Nil(t, s3.MethodOne) - } func TestProxyImplementForContext(t *testing.T) { diff --git a/common/rpc_service_test.go b/common/rpc_service_test.go index e8bd3933da..ce861b75e7 100644 --- a/common/rpc_service_test.go +++ b/common/rpc_service_test.go @@ -39,47 +39,52 @@ const ( testSuiteMethodExpectedString = "interface {}" ) -type TestService struct { -} +type TestService struct{} func (s *TestService) MethodOne(ctx context.Context, arg1, arg2, arg3 interface{}) error { return nil } + func (s *TestService) MethodTwo(arg1, arg2, arg3 interface{}) (interface{}, error) { return struct{}{}, nil } + func (s *TestService) MethodThree() error { return nil } + func (s *TestService) Reference() string { return referenceTestPath } + func (s *TestService) MethodMapper() map[string]string { return map[string]string{ "MethodTwo": "methodTwo", } } -type testService struct { -} +type testService struct{} func (s *testService) Method1(ctx context.Context, args testService, rsp *struct{}) error { return nil } + func (s *testService) Method2(ctx context.Context, args []interface{}) (testService, error) { return testService{}, nil } + func (s *testService) Method3(ctx context.Context, args []interface{}, rsp *struct{}) { } + func (s *testService) Method4(ctx context.Context, args []interface{}, rsp *struct{}) *testService { return nil } + func (s *testService) Reference() string { return referenceTestPath } -type TestService1 struct { -} +type TestService1 struct{} func (s *TestService1) Reference() string { return referenceTestPathDistinct diff --git a/common/url.go b/common/url.go index 80b85fcf42..0e923c5167 100644 --- a/common/url.go +++ b/common/url.go @@ -113,7 +113,7 @@ type URL struct { noCopy noCopy baseUrl - //url.Values is not safe map, add to avoid concurrent map read and map write error + // url.Values is not safe map, add to avoid concurrent map read and map write error paramsLock sync.RWMutex params url.Values diff --git a/common/yaml/yaml.go b/common/yaml/yaml.go index d7e1ca4e89..7f61f7208e 100644 --- a/common/yaml/yaml.go +++ b/common/yaml/yaml.go @@ -49,7 +49,7 @@ func UnmarshalYMLConfig(confProFile string, out interface{}) ([]byte, error) { return confFileStream, yaml.Unmarshal(confFileStream, out) } -//UnmarshalYML unmarshals decodes the first document found within the in byte slice and assigns decoded values into the out value. +// UnmarshalYML unmarshals decodes the first document found within the in byte slice and assigns decoded values into the out value. func UnmarshalYML(data []byte, out interface{}) error { return yaml.Unmarshal(data, out) } diff --git a/config/base_config.go b/config/base_config.go index df1686ae85..0937d51be3 100644 --- a/config/base_config.go +++ b/config/base_config.go @@ -45,7 +45,7 @@ type BaseConfig struct { // application config ApplicationConfig *ApplicationConfig `yaml:"application" json:"application,omitempty" property:"application"` - //prefix string + // prefix string fatherConfig interface{} EventDispatcherType string `default:"direct" yaml:"event_dispatcher_type" json:"event_dispatcher_type,omitempty"` MetricConfig *MetricConfig `yaml:"metrics" json:"metrics,omitempty"` @@ -68,9 +68,7 @@ func (c *BaseConfig) GetRemoteConfig(name string) (config *RemoteConfig, ok bool } func getKeyPrefix(val reflect.Value) []string { - var ( - prefix string - ) + var prefix string configPrefixMethod := "Prefix" if val.CanAddr() { prefix = val.Addr().MethodByName(configPrefixMethod).Call(nil)[0].String() @@ -97,7 +95,6 @@ func setFieldValue(val reflect.Value, id reflect.Value, config *config.InmemoryC f := val.Field(i) if f.IsValid() { setBaseValue := func(f reflect.Value) { - var ( ok bool value string @@ -170,7 +167,6 @@ func setFieldValue(val reflect.Value, id reflect.Value, config *config.InmemoryC } } - } if f.Kind() == reflect.Ptr { @@ -198,7 +194,6 @@ func setFieldValue(val reflect.Value, id reflect.Value, config *config.InmemoryC } } - } if f.Kind() == reflect.Map { diff --git a/config/config_center_config.go b/config/config_center_config.go index 2489709af1..90ad97205a 100644 --- a/config/config_center_config.go +++ b/config/config_center_config.go @@ -44,7 +44,7 @@ import ( // // ConfigCenter has currently supported Zookeeper, Nacos, Etcd, Consul, Apollo type ConfigCenterConfig struct { - //context context.Context + // context context.Context Protocol string `required:"true" yaml:"protocol" json:"protocol,omitempty"` Address string `yaml:"address" json:"address,omitempty"` Cluster string `yaml:"cluster" json:"cluster,omitempty"` @@ -58,7 +58,7 @@ type ConfigCenterConfig struct { AppId string `default:"dubbo" yaml:"app_id" json:"app_id,omitempty"` TimeoutStr string `yaml:"timeout" json:"timeout,omitempty"` RemoteRef string `required:"false" yaml:"remote_ref" json:"remote_ref,omitempty"` - //timeout time.Duration + // timeout time.Duration } // UnmarshalYAML unmarshals the ConfigCenterConfig by @unmarshal function @@ -81,8 +81,7 @@ func (c *ConfigCenterConfig) GetUrlMap() url.Values { return urlMap } -type configCenter struct { -} +type configCenter struct{} // toURL will compatible with baseConfig.ConfigCenterConfig.Address and baseConfig.ConfigCenterConfig.RemoteRef before 1.6.0 // After 1.6.0 will not compatible, only baseConfig.ConfigCenterConfig.RemoteRef diff --git a/config/config_center_config_test.go b/config/config_center_config_test.go index 2299167bb6..58faff3d95 100644 --- a/config/config_center_config_test.go +++ b/config/config_center_config_test.go @@ -62,7 +62,8 @@ func TestStartConfigCenterWithRemoteRef(t *testing.T) { Group: "dubbo", RemoteRef: "mock", ConfigFile: "mockDubbo.properties", - }} + }, + } c := &configCenter{} err := c.startConfigCenter(*baseConfig) @@ -85,7 +86,8 @@ func TestStartConfigCenterWithRemoteRefError(t *testing.T) { Group: "dubbo", RemoteRef: "mock", ConfigFile: "mockDubbo.properties", - }} + }, + } c := &configCenter{} err := c.startConfigCenter(*baseConfig) diff --git a/config/config_loader.go b/config/config_loader.go index 1fd27d5bcd..bb1069ce63 100644 --- a/config/config_loader.go +++ b/config/config_loader.go @@ -74,11 +74,25 @@ func init() { for len(fs.Args()) != 0 { fs.Parse(fs.Args()[1:]) } + // If user did not set the environment variables or flags, + // we provide default value + if confConFile == "" { + confConFile = constant.DEFAULT_CONSUMER_CONF_FILE_PATH + } + if confProFile == "" { + confProFile = constant.DEFAULT_PROVIDER_CONF_FILE_PATH + } + if confRouterFile == "" { + confRouterFile = constant.DEFAULT_ROUTER_CONF_FILE_PATH + } if errCon := ConsumerInit(confConFile); errCon != nil { log.Printf("[consumerInit] %#v", errCon) consumerConfig = nil } else { + // Check if there are some important key fields missing, + // if so, we set a default value for it + setDefaultValue(consumerConfig) // Even though baseConfig has been initialized, we override it // because we think read from config file is correct config baseConfig = &consumerConfig.BaseConfig @@ -88,12 +102,48 @@ func init() { log.Printf("[providerInit] %#v", errPro) providerConfig = nil } else { + // Check if there are some important key fields missing, + // if so, we set a default value for it + setDefaultValue(providerConfig) // Even though baseConfig has been initialized, we override it // because we think read from config file is correct config baseConfig = &providerConfig.BaseConfig } } +// setDefaultValue set default value for providerConfig or consumerConfig if it is null +func setDefaultValue(target interface{}) { + registryConfig := &RegistryConfig{ + Protocol: "zookeeper", + TimeoutStr: "3s", + Address: "127.0.0.1:2181", + } + switch target.(type) { + case *ProviderConfig: + p := target.(*ProviderConfig) + if len(p.Registries) == 0 { + p.Registries["demoZK"] = registryConfig + } + if len(p.Protocols) == 0 { + p.Protocols["dubbo"] = &ProtocolConfig{ + Name: "dubbo", + Port: "20000", + } + } + if p.ApplicationConfig == nil { + p.ApplicationConfig = NewDefaultApplicationConfig() + } + default: + c := target.(*ConsumerConfig) + if len(c.Registries) == 0 { + c.Registries["demoZK"] = registryConfig + } + if c.ApplicationConfig == nil { + c.ApplicationConfig = NewDefaultApplicationConfig() + } + } +} + func checkRegistries(registries map[string]*RegistryConfig, singleRegistry *RegistryConfig) { if len(registries) == 0 && singleRegistry != nil { registries[constant.DEFAULT_KEY] = singleRegistry @@ -151,7 +201,7 @@ func loadConsumerConfig() { if data, err := yaml.MarshalYML(consumerConfig); err != nil { logger.Errorf("Marshal consumer config err: %s", err.Error()) } else { - if err := ioutil.WriteFile(consumerConfig.CacheFile, data, 0666); err != nil { + if err := ioutil.WriteFile(consumerConfig.CacheFile, data, 0o666); err != nil { logger.Errorf("Write consumer config cache file err: %s", err.Error()) } } @@ -218,7 +268,7 @@ func loadProviderConfig() { if data, err := yaml.MarshalYML(providerConfig); err != nil { logger.Errorf("Marshal provider config err: %s", err.Error()) } else { - if err := ioutil.WriteFile(providerConfig.CacheFile, data, 0666); err != nil { + if err := ioutil.WriteFile(providerConfig.CacheFile, data, 0o666); err != nil { logger.Errorf("Write provider config cache file err: %s", err.Error()) } } @@ -337,7 +387,6 @@ func initRouter() { // Load Dubbo Init func Load() { - // init router initRouter() @@ -448,9 +497,11 @@ func GetBaseConfig() *BaseConfig { func GetSslEnabled() bool { return sslEnabled } + func SetSslEnabled(enabled bool) { sslEnabled = enabled } + func IsProvider() bool { return providerConfig != nil } diff --git a/config/config_loader_test.go b/config/config_loader_test.go index 5cda3b2a99..c43a4aef36 100644 --- a/config/config_loader_test.go +++ b/config/config_loader_test.go @@ -45,8 +45,10 @@ import ( "github.com/apache/dubbo-go/registry" ) -const mockConsumerConfigPath = "./testdata/consumer_config.yml" -const mockProviderConfigPath = "./testdata/provider_config.yml" +const ( + mockConsumerConfigPath = "./testdata/consumer_config.yml" + mockProviderConfigPath = "./testdata/provider_config.yml" +) func TestConfigLoader(t *testing.T) { conPath, err := filepath.Abs(mockConsumerConfigPath) @@ -191,6 +193,26 @@ func TestWithNoRegLoad(t *testing.T) { providerConfig = nil } +func TestSetDefaultValue(t *testing.T) { + proConfig := &ProviderConfig{Registries: make(map[string]*RegistryConfig), Protocols: make(map[string]*ProtocolConfig)} + assert.Nil(t, proConfig.ApplicationConfig) + setDefaultValue(proConfig) + assert.Equal(t, proConfig.Registries["demoZK"].Address, "127.0.0.1:2181") + assert.Equal(t, proConfig.Registries["demoZK"].TimeoutStr, "3s") + assert.Equal(t, proConfig.Registries["demoZK"].Protocol, "zookeeper") + assert.Equal(t, proConfig.Protocols["dubbo"].Name, "dubbo") + assert.Equal(t, proConfig.Protocols["dubbo"].Port, "20000") + assert.NotNil(t, proConfig.ApplicationConfig) + + conConfig := &ConsumerConfig{Registries: make(map[string]*RegistryConfig)} + assert.Nil(t, conConfig.ApplicationConfig) + setDefaultValue(conConfig) + assert.Equal(t, conConfig.Registries["demoZK"].Address, "127.0.0.1:2181") + assert.Equal(t, conConfig.Registries["demoZK"].TimeoutStr, "3s") + assert.Equal(t, conConfig.Registries["demoZK"].Protocol, "zookeeper") + assert.NotNil(t, conConfig.ApplicationConfig) + +} func TestConfigLoaderWithConfigCenter(t *testing.T) { extension.SetConfigCenterFactory("mock", func() config_center.DynamicConfigurationFactory { return &config_center.MockDynamicConfigurationFactory{} @@ -222,7 +244,6 @@ func TestConfigLoaderWithConfigCenter(t *testing.T) { assert.Equal(t, "BDTService", consumerConfig.ApplicationConfig.Name) assert.Equal(t, "127.0.0.1:2181", consumerConfig.Registries["hangzhouzk"].Address) - } func TestConfigLoaderWithConfigCenterSingleRegistry(t *testing.T) { @@ -281,7 +302,6 @@ func TestConfigLoaderWithConfigCenterSingleRegistry(t *testing.T) { assert.Equal(t, "BDTService", consumerConfig.ApplicationConfig.Name) assert.Equal(t, "mock://127.0.0.1:2182", consumerConfig.Registries[constant.DEFAULT_KEY].Address) - } func TestGetBaseConfig(t *testing.T) { @@ -301,7 +321,8 @@ func mockInitProviderWithSingleRegistry() { Module: "module", Version: "1.0.0", Owner: "dubbo", - Environment: "test"}, + Environment: "test", + }, }, Registry: &RegistryConfig{ @@ -452,8 +473,7 @@ func (m *mockMetadataService) getAllService(services *sync.Map) []*common.URL { return res } -type mockServiceDiscoveryRegistry struct { -} +type mockServiceDiscoveryRegistry struct{} func (mr *mockServiceDiscoveryRegistry) GetUrl() *common.URL { panic("implement me") @@ -487,8 +507,7 @@ func (s *mockServiceDiscoveryRegistry) GetServiceDiscovery() registry.ServiceDis return &mockServiceDiscovery{} } -type mockServiceDiscovery struct { -} +type mockServiceDiscovery struct{} func (m *mockServiceDiscovery) String() string { panic("implement me") diff --git a/config/consumer_config.go b/config/consumer_config.go index ca88fe3d84..39c0e96f94 100644 --- a/config/consumer_config.go +++ b/config/consumer_config.go @@ -95,9 +95,9 @@ func ConsumerInit(confConFile string) error { return perrors.Errorf("unmarshalYmlConfig error %v", perrors.WithStack(err)) } consumerConfig.fileStream = bytes.NewBuffer(fileStream) - //set method interfaceId & interfaceName + // set method interfaceId & interfaceName for k, v := range consumerConfig.References { - //set id for reference + // set id for reference for _, n := range consumerConfig.References[k].Methods { n.InterfaceName = v.InterfaceName n.InterfaceId = k @@ -124,7 +124,7 @@ func ConsumerInit(confConFile string) error { } func configCenterRefreshConsumer() error { - //fresh it + // fresh it var err error if consumerConfig.Request_Timeout != "" { if consumerConfig.RequestTimeout, err = time.ParseDuration(consumerConfig.Request_Timeout); err != nil { diff --git a/config/graceful_shutdown.go b/config/graceful_shutdown.go index 89ac2e38fc..83204c83f8 100644 --- a/config/graceful_shutdown.go +++ b/config/graceful_shutdown.go @@ -55,7 +55,6 @@ const defaultShutDownTime = time.Second * 60 // nolint func GracefulShutdownInit() { - signals := make(chan os.Signal, 1) signal.Notify(signals, ShutdownSignals...) @@ -83,7 +82,6 @@ func GracefulShutdownInit() { // BeforeShutdown provides processing flow before shutdown func BeforeShutdown() { - destroyAllRegistries() // waiting for a short time so that the clients have enough time to get the notification that server shutdowns // The value of configuration depends on how long the clients will get notification. @@ -127,7 +125,6 @@ func destroyConsumerProtocols(consumerProtocols *gxset.HashSet) { // destroyProviderProtocols destroys the provider's protocol. // if the protocol is consumer's protocol too, we will keep it func destroyProviderProtocols(consumerProtocols *gxset.HashSet) { - logger.Info("Graceful shutdown --- Destroy provider's protocols. ") if providerConfig == nil || providerConfig.Protocols == nil { @@ -145,7 +142,6 @@ func destroyProviderProtocols(consumerProtocols *gxset.HashSet) { } func waitAndAcceptNewRequests() { - logger.Info("Graceful shutdown --- Keep waiting and accept new requests for a short time. ") if providerConfig == nil || providerConfig.ShutdownConfig == nil { return @@ -194,7 +190,7 @@ func waitingProcessedTimeout(shutdownConfig *ShutdownConfig) { } func totalTimeout() time.Duration { - var providerShutdown = defaultShutDownTime + providerShutdown := defaultShutDownTime if providerConfig != nil && providerConfig.ShutdownConfig != nil { providerShutdown = providerConfig.ShutdownConfig.GetTimeout() } @@ -204,7 +200,7 @@ func totalTimeout() time.Duration { consumerShutdown = consumerConfig.ShutdownConfig.GetTimeout() } - var timeout = providerShutdown + timeout := providerShutdown if consumerShutdown > providerShutdown { timeout = consumerShutdown } diff --git a/config/graceful_shutdown_signal_darwin.go b/config/graceful_shutdown_signal_darwin.go index 1a557dd3ed..9b694b5e09 100644 --- a/config/graceful_shutdown_signal_darwin.go +++ b/config/graceful_shutdown_signal_darwin.go @@ -24,11 +24,15 @@ import ( var ( // ShutdownSignals receives shutdown signals to process - ShutdownSignals = []os.Signal{os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP, + ShutdownSignals = []os.Signal{ + os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, - syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM} + syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM, + } // DumpHeapShutdownSignals receives shutdown signals to process - DumpHeapShutdownSignals = []os.Signal{syscall.SIGQUIT, syscall.SIGILL, - syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS} + DumpHeapShutdownSignals = []os.Signal{ + syscall.SIGQUIT, syscall.SIGILL, + syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS, + } ) diff --git a/config/graceful_shutdown_signal_linux.go b/config/graceful_shutdown_signal_linux.go index 1a557dd3ed..9b694b5e09 100644 --- a/config/graceful_shutdown_signal_linux.go +++ b/config/graceful_shutdown_signal_linux.go @@ -24,11 +24,15 @@ import ( var ( // ShutdownSignals receives shutdown signals to process - ShutdownSignals = []os.Signal{os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP, + ShutdownSignals = []os.Signal{ + os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGSTOP, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, - syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM} + syscall.SIGABRT, syscall.SIGSYS, syscall.SIGTERM, + } // DumpHeapShutdownSignals receives shutdown signals to process - DumpHeapShutdownSignals = []os.Signal{syscall.SIGQUIT, syscall.SIGILL, - syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS} + DumpHeapShutdownSignals = []os.Signal{ + syscall.SIGQUIT, syscall.SIGILL, + syscall.SIGTRAP, syscall.SIGABRT, syscall.SIGSYS, + } ) diff --git a/config/graceful_shutdown_signal_windows.go b/config/graceful_shutdown_signal_windows.go index 89edd27b18..17c209e8f5 100644 --- a/config/graceful_shutdown_signal_windows.go +++ b/config/graceful_shutdown_signal_windows.go @@ -24,9 +24,11 @@ import ( var ( // ShutdownSignals receives shutdown signals to process - ShutdownSignals = []os.Signal{os.Interrupt, os.Kill, syscall.SIGKILL, + ShutdownSignals = []os.Signal{ + os.Interrupt, os.Kill, syscall.SIGKILL, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, - syscall.SIGABRT, syscall.SIGTERM} + syscall.SIGABRT, syscall.SIGTERM, + } // DumpHeapShutdownSignals receives shutdown signals to process DumpHeapShutdownSignals = []os.Signal{syscall.SIGQUIT, syscall.SIGILL, syscall.SIGTRAP, syscall.SIGABRT} diff --git a/config/graceful_shutdown_test.go b/config/graceful_shutdown_test.go index de203572c7..851ec75adf 100644 --- a/config/graceful_shutdown_test.go +++ b/config/graceful_shutdown_test.go @@ -57,7 +57,8 @@ func TestBeforeShutdown(t *testing.T) { ShutdownConfig: &ShutdownConfig{ Timeout: "1", StepTimeout: "1s", - }} + }, + } providerProtocols := map[string]*ProtocolConfig{} providerProtocols[constant.DUBBO] = &ProtocolConfig{ diff --git a/config/instance/metadata_report_test.go b/config/instance/metadata_report_test.go index 110903a41f..7d4a93ad13 100644 --- a/config/instance/metadata_report_test.go +++ b/config/instance/metadata_report_test.go @@ -42,15 +42,13 @@ func TestGetMetadataReportInstance(t *testing.T) { assert.NotNil(t, rpt) } -type mockMetadataReportFactory struct { -} +type mockMetadataReportFactory struct{} func (m *mockMetadataReportFactory) CreateMetadataReport(*common.URL) report.MetadataReport { return &mockMetadataReport{} } -type mockMetadataReport struct { -} +type mockMetadataReport struct{} func (m mockMetadataReport) StoreProviderMetadata(*identifier.MetadataIdentifier, string) error { panic("implement me") diff --git a/config/metric_config.go b/config/metric_config.go index 73a3ca1cfe..9af1691dad 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -17,9 +17,7 @@ package config -var ( - defaultHistogramBucket = []float64{10, 50, 100, 200, 500, 1000, 10000} -) +var defaultHistogramBucket = []float64{10, 50, 100, 200, 500, 1000, 10000} // This is the config struct for all metrics implementation type MetricConfig struct { diff --git a/config/reference_config.go b/config/reference_config.go index f71c7ec192..a97018acc7 100644 --- a/config/reference_config.go +++ b/config/reference_config.go @@ -194,7 +194,7 @@ func (c *ReferenceConfig) GetProxy() *proxy.Proxy { func (c *ReferenceConfig) getUrlMap() url.Values { urlMap := url.Values{} - //first set user params + // first set user params for k, v := range c.Params { urlMap.Set(k, v) } @@ -215,11 +215,11 @@ func (c *ReferenceConfig) getUrlMap() url.Values { if len(c.RequestTimeout) != 0 { urlMap.Set(constant.TIMEOUT_KEY, c.RequestTimeout) } - //getty invoke async or sync + // getty invoke async or sync urlMap.Set(constant.ASYNC_KEY, strconv.FormatBool(c.Async)) urlMap.Set(constant.STICKY_KEY, strconv.FormatBool(c.Sticky)) - //application info + // application info urlMap.Set(constant.APPLICATION_KEY, consumerConfig.ApplicationConfig.Name) urlMap.Set(constant.ORGANIZATION_KEY, consumerConfig.ApplicationConfig.Organization) urlMap.Set(constant.NAME_KEY, consumerConfig.ApplicationConfig.Name) @@ -228,8 +228,8 @@ func (c *ReferenceConfig) getUrlMap() url.Values { urlMap.Set(constant.OWNER_KEY, consumerConfig.ApplicationConfig.Owner) urlMap.Set(constant.ENVIRONMENT_KEY, consumerConfig.ApplicationConfig.Environment) - //filter - var defaultReferenceFilter = constant.DEFAULT_REFERENCE_FILTERS + // filter + defaultReferenceFilter := constant.DEFAULT_REFERENCE_FILTERS if c.Generic { defaultReferenceFilter = constant.GENERIC_REFERENCE_FILTERS + "," + defaultReferenceFilter } diff --git a/config/reference_config_test.go b/config/reference_config_test.go index 0207e1ff24..f47bb4bd84 100644 --- a/config/reference_config_test.go +++ b/config/reference_config_test.go @@ -46,7 +46,8 @@ func doInitConsumer() { Module: "module", Version: "2.6.0", Owner: "dubbo", - Environment: "test"}, + Environment: "test", + }, }, Registries: map[string]*RegistryConfig{ @@ -120,8 +121,7 @@ func doInitConsumer() { var mockProvider = new(MockProvider) -type MockProvider struct { -} +type MockProvider struct{} func (m *MockProvider) Reference() string { return "MockProvider" @@ -148,7 +148,8 @@ func doInitConsumerWithSingleRegistry() { Module: "module", Version: "2.6.0", Owner: "dubbo", - Environment: "test"}, + Environment: "test", + }, }, Registry: &RegistryConfig{ @@ -359,6 +360,7 @@ func (*mockRegistryProtocol) Export(invoker protocol.Invoker) protocol.Exporter func (*mockRegistryProtocol) Destroy() { // Destroy is a mock function } + func getRegistryUrl(invoker protocol.Invoker) *common.URL { // here add * for return a new url url := invoker.GetUrl() diff --git a/config/registry_config.go b/config/registry_config.go index ed81a07c63..462e3b88cb 100644 --- a/config/registry_config.go +++ b/config/registry_config.go @@ -129,7 +129,7 @@ func (c *RegistryConfig) getUrlMap(roleType common.RoleType) url.Values { urlMap.Set(constant.REGISTRY_KEY+"."+constant.REGISTRY_LABEL_KEY, strconv.FormatBool(true)) urlMap.Set(constant.REGISTRY_KEY+"."+constant.PREFERRED_KEY, strconv.FormatBool(c.Preferred)) urlMap.Set(constant.REGISTRY_KEY+"."+constant.ZONE_KEY, c.Zone) - //urlMap.Set(constant.REGISTRY_KEY+"."+constant.ZONE_FORCE_KEY, strconv.FormatBool(c.ZoneForce)) + // urlMap.Set(constant.REGISTRY_KEY+"."+constant.ZONE_FORCE_KEY, strconv.FormatBool(c.ZoneForce)) urlMap.Set(constant.REGISTRY_KEY+"."+constant.WEIGHT_KEY, strconv.FormatInt(c.Weight, 10)) urlMap.Set(constant.REGISTRY_TTL_KEY, c.TTL) for k, v := range c.Params { diff --git a/config/remote_config_test.go b/config/remote_config_test.go index 82535fd60b..cd21369565 100644 --- a/config/remote_config_test.go +++ b/config/remote_config_test.go @@ -20,6 +20,7 @@ package config import ( "testing" ) + import ( "github.com/stretchr/testify/assert" ) diff --git a/config/router_config.go b/config/router_config.go index ea19b46800..06758b4c94 100644 --- a/config/router_config.go +++ b/config/router_config.go @@ -29,9 +29,7 @@ import ( "github.com/apache/dubbo-go/common/yaml" ) -var ( - routerURLSet = gxset.NewSet() -) +var routerURLSet = gxset.NewSet() // LocalRouterRules defines the local router config structure type LocalRouterRules struct { diff --git a/config/router_config_test.go b/config/router_config_test.go index 13af7056d5..d2acf9d1ea 100644 --- a/config/router_config_test.go +++ b/config/router_config_test.go @@ -31,12 +31,13 @@ import ( _ "github.com/apache/dubbo-go/cluster/router/condition" ) -const testYML = "testdata/router_config.yml" -const testMultiRouterYML = "testdata/router_multi_config.yml" -const errorTestYML = "testdata/router_config_error.yml" +const ( + testYML = "testdata/router_config.yml" + testMultiRouterYML = "testdata/router_multi_config.yml" + errorTestYML = "testdata/router_config_error.yml" +) func TestString(t *testing.T) { - s := "a1=>a2" s1 := "=>a2" s2 := "a1=>" diff --git a/config/service_config_test.go b/config/service_config_test.go index aea0bde7a2..76800d97c1 100644 --- a/config/service_config_test.go +++ b/config/service_config_test.go @@ -18,8 +18,9 @@ package config import ( - "github.com/apache/dubbo-go/common" "testing" + + "github.com/apache/dubbo-go/common" ) import ( @@ -195,7 +196,7 @@ func TestGetRandomPort(t *testing.T) { protocolConfigs = append(protocolConfigs, &ProtocolConfig{ Ip: ip, }) - //assert.NoError(t, err) + // assert.NoError(t, err) ports := getRandomPort(protocolConfigs) assert.Equal(t, ports.Len(), len(protocolConfigs)) diff --git a/config_center/apollo/factory.go b/config_center/apollo/factory.go index c52d942c4f..e3a8364f40 100644 --- a/config_center/apollo/factory.go +++ b/config_center/apollo/factory.go @@ -42,5 +42,4 @@ func (f *apolloConfigurationFactory) GetDynamicConfiguration(url *common.URL) (c } dynamicConfiguration.SetParser(&parser.DefaultConfigurationParser{}) return dynamicConfiguration, err - } diff --git a/config_center/apollo/impl_test.go b/config_center/apollo/impl_test.go index 3b2cb16840..8f4c3151df 100644 --- a/config_center/apollo/impl_test.go +++ b/config_center/apollo/impl_test.go @@ -59,8 +59,7 @@ const ( }]` ) -var ( - mockConfigRes = `{ +var mockConfigRes = `{ "appId": "testApplication_yang", "cluster": "default", "namespaceName": "mockDubbog.properties", @@ -116,7 +115,6 @@ var ( }, "releaseKey": "20191104105242-0f13805d89f834a4" }` -) func initApollo() *httptest.Server { handlerMap := make(map[string]func(http.ResponseWriter, *http.Request), 1) @@ -215,13 +213,13 @@ func TestListener(t *testing.T) { }, "releaseKey": "20191104105242-0f13805d89f834a4" }` - //test add + // test add apollo.AddListener(mockNamespace, listener) listener.wg.Wait() assert.Equal(t, "mockDubbog.properties", listener.event) assert.Greater(t, listener.count, 0) - //test remove + // test remove apollo.RemoveListener(mockNamespace, listener) listenerCount := 0 apollo.listeners.Range(func(_, value interface{}) bool { diff --git a/config_center/apollo/listener.go b/config_center/apollo/listener.go index 44d325582f..215c74d862 100644 --- a/config_center/apollo/listener.go +++ b/config_center/apollo/listener.go @@ -42,7 +42,6 @@ func newApolloListener() *apolloListener { // OnChange process each listener func (a *apolloListener) OnChange(changeEvent *storage.ChangeEvent) { - } // OnNewestChange process each listener by all changes diff --git a/config_center/base_dynamic_configuration.go b/config_center/base_dynamic_configuration.go index 3d6757852a..b56ada1e39 100644 --- a/config_center/base_dynamic_configuration.go +++ b/config_center/base_dynamic_configuration.go @@ -18,8 +18,7 @@ package config_center // BaseDynamicConfiguration will default implementation DynamicConfiguration some method -type BaseDynamicConfiguration struct { -} +type BaseDynamicConfiguration struct{} // RemoveConfig func (bdc *BaseDynamicConfiguration) RemoveConfig(string, string) error { diff --git a/config_center/configurator/override_test.go b/config_center/configurator/override_test.go index 4d2552d184..a7fced09ab 100644 --- a/config_center/configurator/override_test.go +++ b/config_center/configurator/override_test.go @@ -71,7 +71,6 @@ func TestConfigureVersion2p6WithIp(t *testing.T) { assert.NoError(t, err) configurator.Configure(providerUrl) assert.Equal(t, failfast, providerUrl.GetParam(constant.CLUSTER_KEY, "")) - } func TestConfigureVersion2p7(t *testing.T) { @@ -83,5 +82,4 @@ func TestConfigureVersion2p7(t *testing.T) { assert.NoError(t, err) configurator.Configure(providerUrl) assert.Equal(t, failfast, providerUrl.GetParam(constant.CLUSTER_KEY, "")) - } diff --git a/config_center/file/factory.go b/config_center/file/factory.go index 2dda900e20..5dc8be170c 100644 --- a/config_center/file/factory.go +++ b/config_center/file/factory.go @@ -35,8 +35,7 @@ func init() { }) } -type fileDynamicConfigurationFactory struct { -} +type fileDynamicConfigurationFactory struct{} // GetDynamicConfiguration Get Configuration with URL func (f *fileDynamicConfigurationFactory) GetDynamicConfiguration(url *common.URL) (config_center.DynamicConfiguration, diff --git a/config_center/file/impl.go b/config_center/file/impl.go index 6489a073de..112b0bb254 100644 --- a/config_center/file/impl.go +++ b/config_center/file/impl.go @@ -40,9 +40,7 @@ import ( "github.com/apache/dubbo-go/config_center/parser" ) -var ( - osType = runtime.GOOS -) +var osType = runtime.GOOS const ( windowsOS = "windows" diff --git a/config_center/file/listener.go b/config_center/file/listener.go index d569030e5a..8e7aa61ed8 100644 --- a/config_center/file/listener.go +++ b/config_center/file/listener.go @@ -128,7 +128,8 @@ func (cl *CacheListener) AddListener(key string, listener config_center.Configur // reference from https://stackoverflow.com/questions/34018908/golang-why-dont-we-have-a-set-datastructure // make a map[your type]struct{} like set in java listeners, loaded := cl.keyListeners.LoadOrStore(key, map[config_center.ConfigurationListener]struct{}{ - listener: {}}) + listener: {}, + }) if loaded { listeners.(map[config_center.ConfigurationListener]struct{})[listener] = struct{}{} cl.keyListeners.Store(key, listeners) diff --git a/config_center/mock_dynamic_config.go b/config_center/mock_dynamic_config.go index 9bebd600c6..5688499fe9 100644 --- a/config_center/mock_dynamic_config.go +++ b/config_center/mock_dynamic_config.go @@ -83,7 +83,6 @@ func (f *MockDynamicConfigurationFactory) GetDynamicConfiguration(_ *common.URL) dynamicConfiguration.content = f.Content } return dynamicConfiguration, err - } // PublishConfig will publish the config with the (key, group, value) pair @@ -116,7 +115,6 @@ func (c *MockDynamicConfiguration) RemoveListener(_ string, _ ConfigurationListe // GetConfig returns content of MockDynamicConfiguration func (c *MockDynamicConfiguration) GetConfig(_ string, _ ...Option) (string, error) { - return c.content, nil } @@ -158,7 +156,8 @@ func (c *MockDynamicConfiguration) MockServiceConfigEvent() { Key: mockServiceName, Enabled: true, Configs: []parser.ConfigItem{ - {Type: parser.GeneralType, + { + Type: parser.GeneralType, Enabled: true, Addresses: []string{"0.0.0.0"}, Services: []string{mockServiceName}, @@ -180,7 +179,8 @@ func (c *MockDynamicConfiguration) MockApplicationConfigEvent() { Key: mockServiceName, Enabled: true, Configs: []parser.ConfigItem{ - {Type: parser.ScopeApplication, + { + Type: parser.ScopeApplication, Enabled: true, Addresses: []string{"0.0.0.0"}, Services: []string{mockServiceName}, diff --git a/config_center/nacos/client.go b/config_center/nacos/client.go index 1e96b36a4f..d6af806edd 100644 --- a/config_center/nacos/client.go +++ b/config_center/nacos/client.go @@ -65,7 +65,7 @@ type option func(*options) type options struct { nacosName string - //client *NacosClient + // client *NacosClient } // WithNacosName Set nacos name @@ -94,7 +94,7 @@ func ValidateNacosClient(container nacosClientFacade, opts ...option) error { } nacosAddresses := strings.Split(url.Location, ",") if container.NacosClient() == nil { - //in dubbo ,every registry only connect one node ,so this is []string{r.Address} + // in dubbo ,every registry only connect one node ,so this is []string{r.Address} newClient, err := newNacosClient(os.nacosName, nacosAddresses, timeout, url) if err != nil { logger.Errorf("newNacosClient(name{%s}, nacos address{%v}, timeout{%d}) = error{%v}", diff --git a/config_center/nacos/facade.go b/config_center/nacos/facade.go index d089ed26d2..b81c22416f 100644 --- a/config_center/nacos/facade.go +++ b/config_center/nacos/facade.go @@ -21,6 +21,7 @@ import ( "sync" "time" ) + import ( "github.com/apache/dubbo-getty" perrors "github.com/pkg/errors" diff --git a/config_center/nacos/factory.go b/config_center/nacos/factory.go index 3de91ea013..da06abd6e4 100644 --- a/config_center/nacos/factory.go +++ b/config_center/nacos/factory.go @@ -28,8 +28,7 @@ func init() { extension.SetConfigCenterFactory("nacos", func() config_center.DynamicConfigurationFactory { return &nacosDynamicConfigurationFactory{} }) } -type nacosDynamicConfigurationFactory struct { -} +type nacosDynamicConfigurationFactory struct{} // GetDynamicConfiguration Get Configuration with URL func (f *nacosDynamicConfigurationFactory) GetDynamicConfiguration(url *common.URL) (config_center.DynamicConfiguration, error) { @@ -39,5 +38,4 @@ func (f *nacosDynamicConfigurationFactory) GetDynamicConfiguration(url *common.U } dynamicConfiguration.SetParser(&parser.DefaultConfigurationParser{}) return dynamicConfiguration, err - } diff --git a/config_center/nacos/impl.go b/config_center/nacos/impl.go index 7c67930026..8e56d23273 100644 --- a/config_center/nacos/impl.go +++ b/config_center/nacos/impl.go @@ -72,7 +72,6 @@ func newNacosDynamicConfiguration(url *common.URL) (*nacosDynamicConfiguration, c.wg.Add(1) go HandleClientRestart(c) return c, err - } // AddListener Add listener @@ -97,7 +96,6 @@ func (n *nacosDynamicConfiguration) GetInternalProperty(key string, opts ...conf // PublishConfig will publish the config with the (key, group, value) pair func (n *nacosDynamicConfiguration) PublishConfig(key string, group string, value string) error { - group = n.resolvedGroup(group) ok, err := (*n.client.Client()).PublishConfig(vo.ConfigParam{ @@ -105,7 +103,6 @@ func (n *nacosDynamicConfiguration) PublishConfig(key string, group string, valu Group: group, Content: value, }) - if err != nil { return perrors.WithStack(err) } diff --git a/config_center/nacos/impl_test.go b/config_center/nacos/impl_test.go index b7bd94bf96..0372a6cecb 100644 --- a/config_center/nacos/impl_test.go +++ b/config_center/nacos/impl_test.go @@ -117,7 +117,6 @@ func TestNacosDynamicConfiguration_GetConfigKeysByGroup(t *testing.T) { assert.Nil(t, err) assert.Equal(t, 1, configs.Size()) assert.True(t, configs.Contains("application")) - } func TestNacosDynamicConfigurationPublishConfig(t *testing.T) { @@ -139,7 +138,7 @@ func TestAddListener(t *testing.T) { } func TestRemoveListener(_ *testing.T) { - //TODO not supported in current go_nacos_sdk version + // TODO not supported in current go_nacos_sdk version } type mockDataListener struct { diff --git a/config_center/parser/configuration_parser.go b/config_center/parser/configuration_parser.go index b104d3ddb6..eb811c0625 100644 --- a/config_center/parser/configuration_parser.go +++ b/config_center/parser/configuration_parser.go @@ -112,7 +112,7 @@ func (parser *DefaultConfigurationParser) ParseToUrls(content string) ([]*common // serviceItemToUrls is used to transfer item and config to urls func serviceItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.URL, error) { - var addresses = item.Addresses + addresses := item.Addresses if len(addresses) == 0 { addresses = append(addresses, constant.ANYHOST_VALUE) } @@ -159,7 +159,7 @@ func serviceItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.UR // nolint func appItemToUrls(item ConfigItem, config ConfiguratorConfig) ([]*common.URL, error) { - var addresses = item.Addresses + addresses := item.Addresses if len(addresses) == 0 { addresses = append(addresses, constant.ANYHOST_VALUE) } diff --git a/config_center/zookeeper/factory.go b/config_center/zookeeper/factory.go index 3f4690d4e0..8e91972507 100644 --- a/config_center/zookeeper/factory.go +++ b/config_center/zookeeper/factory.go @@ -28,8 +28,7 @@ func init() { extension.SetConfigCenterFactory("zookeeper", func() config_center.DynamicConfigurationFactory { return &zookeeperDynamicConfigurationFactory{} }) } -type zookeeperDynamicConfigurationFactory struct { -} +type zookeeperDynamicConfigurationFactory struct{} func (f *zookeeperDynamicConfigurationFactory) GetDynamicConfiguration(url *common.URL) (config_center.DynamicConfiguration, error) { dynamicConfiguration, err := newZookeeperDynamicConfiguration(url) @@ -38,5 +37,4 @@ func (f *zookeeperDynamicConfigurationFactory) GetDynamicConfiguration(url *comm } dynamicConfiguration.SetParser(&parser.DefaultConfigurationParser{}) return dynamicConfiguration, err - } diff --git a/config_center/zookeeper/impl.go b/config_center/zookeeper/impl.go index e24e63fd03..082bfbecd3 100644 --- a/config_center/zookeeper/impl.go +++ b/config_center/zookeeper/impl.go @@ -53,7 +53,7 @@ type zookeeperDynamicConfiguration struct { done chan struct{} client *gxzookeeper.ZookeeperClient - //listenerLock sync.Mutex + // listenerLock sync.Mutex listener *zookeeper.ZkEventListener cacheListener *CacheListener parser parser.ConfigurationParser @@ -78,7 +78,6 @@ func newZookeeperDynamicConfiguration(url *common.URL) (*zookeeperDynamicConfigu err = c.client.Create(c.rootPath) c.listener.ListenServiceEvent(url, c.rootPath, c.cacheListener) return c, err - } func (c *zookeeperDynamicConfiguration) AddListener(key string, listener config_center.ConfigurationListener, opions ...config_center.Option) { @@ -90,7 +89,6 @@ func (c *zookeeperDynamicConfiguration) RemoveListener(key string, listener conf } func (c *zookeeperDynamicConfiguration) GetProperties(key string, opts ...config_center.Option) (string, error) { - tmpOpts := &config_center.Options{} for _, opt := range opts { opt(tmpOpts) diff --git a/config_center/zookeeper/impl_test.go b/config_center/zookeeper/impl_test.go index 7f17153e24..26d7870482 100644 --- a/config_center/zookeeper/impl_test.go +++ b/config_center/zookeeper/impl_test.go @@ -218,7 +218,6 @@ func TestZookeeperDynamicConfigurationPublishConfig(t *testing.T) { assert.Nil(t, err) assert.Equal(t, 1, keys.Size()) assert.True(t, keys.Contains(key)) - } type mockDataListener struct { diff --git a/config_center/zookeeper/listener.go b/config_center/zookeeper/listener.go index 244451a2d0..d93e9d53d4 100644 --- a/config_center/zookeeper/listener.go +++ b/config_center/zookeeper/listener.go @@ -41,7 +41,6 @@ func NewCacheListener(rootPath string) *CacheListener { // AddListener will add a listener if loaded func (l *CacheListener) AddListener(key string, listener config_center.ConfigurationListener) { - // reference from https://stackoverflow.com/questions/34018908/golang-why-dont-we-have-a-set-datastructure // make a map[your type]struct{} like set in java listeners, loaded := l.keyListeners.LoadOrStore(key, map[config_center.ConfigurationListener]struct{}{listener: {}}) @@ -62,7 +61,7 @@ func (l *CacheListener) RemoveListener(key string, listener config_center.Config // DataChange changes all listeners' event func (l *CacheListener) DataChange(event remoting.Event) bool { if event.Content == "" { - //meanings new node + // meanings new node return true } key := l.pathToKey(event.Path) @@ -82,7 +81,7 @@ func (l *CacheListener) pathToKey(path string) string { if strings.HasSuffix(key, constant.CONFIGURATORS_SUFFIX) || strings.HasSuffix(key, constant.TagRouterRuleSuffix) || strings.HasSuffix(key, constant.ConditionRouterRuleSuffix) { - //governance config, so we remove the "dubbo." prefix + // governance config, so we remove the "dubbo." prefix return key[strings.Index(key, ".")+1:] } return key diff --git a/filter/filter_impl/access_log_filter.go b/filter/filter_impl/access_log_filter.go index 167b5edd80..6aa4e65222 100644 --- a/filter/filter_impl/access_log_filter.go +++ b/filter/filter_impl/access_log_filter.go @@ -34,7 +34,7 @@ import ( ) const ( - //used in URL. + // used in URL. // nolint FileDateFormat = "2006-01-02" @@ -43,7 +43,7 @@ const ( // nolint LogMaxBuffer = 5000 // nolint - LogFileMode = 0600 + LogFileMode = 0o600 // those fields are the data collected by this filter diff --git a/filter/filter_impl/active_filter.go b/filter/filter_impl/active_filter.go index 795de968b5..a391cb3ee3 100644 --- a/filter/filter_impl/active_filter.go +++ b/filter/filter_impl/active_filter.go @@ -40,8 +40,7 @@ func init() { } // ActiveFilter tracks the requests status -type ActiveFilter struct { -} +type ActiveFilter struct{} // Invoke starts to record the requests status func (ef *ActiveFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { diff --git a/filter/filter_impl/active_filter_test.go b/filter/filter_impl/active_filter_test.go index 2397503dc8..bb1676d3b8 100644 --- a/filter/filter_impl/active_filter_test.go +++ b/filter/filter_impl/active_filter_test.go @@ -47,7 +47,6 @@ func TestActiveFilterInvoke(t *testing.T) { invoker.EXPECT().GetUrl().Return(url).Times(1) filter.Invoke(context.Background(), invoker, invoc) assert.True(t, invoc.AttachmentsByKey(dubboInvokeStartTime, "") != "") - } func TestActiveFilterOnResponse(t *testing.T) { @@ -79,5 +78,4 @@ func TestActiveFilterOnResponse(t *testing.T) { assert.True(t, urlStatus.GetFailedElapsed() >= int64(elapsed)) assert.True(t, urlStatus.GetLastRequestFailedTimestamp() != int64(0)) assert.True(t, methodStatus.GetLastRequestFailedTimestamp() != int64(0)) - } diff --git a/filter/filter_impl/auth/accesskey_storage.go b/filter/filter_impl/auth/accesskey_storage.go index 90d3efb5ad..de49bcbc79 100644 --- a/filter/filter_impl/auth/accesskey_storage.go +++ b/filter/filter_impl/auth/accesskey_storage.go @@ -26,8 +26,7 @@ import ( ) // DefaultAccesskeyStorage is the default implementation of AccesskeyStorage -type DefaultAccesskeyStorage struct { -} +type DefaultAccesskeyStorage struct{} // GetAccessKeyPair retrieves AccessKeyPair from url by the key "accessKeyId" and "secretAccessKey" func (storage *DefaultAccesskeyStorage) GetAccessKeyPair(invocation protocol.Invocation, url *common.URL) *filter.AccessKeyPair { diff --git a/filter/filter_impl/auth/consumer_sign.go b/filter/filter_impl/auth/consumer_sign.go index 823db82bfc..3e298cdc3d 100644 --- a/filter/filter_impl/auth/consumer_sign.go +++ b/filter/filter_impl/auth/consumer_sign.go @@ -21,6 +21,7 @@ import ( "context" "fmt" ) + import ( "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" @@ -30,8 +31,7 @@ import ( ) // ConsumerSignFilter signs the request on consumer side -type ConsumerSignFilter struct { -} +type ConsumerSignFilter struct{} func init() { extension.SetFilter(constant.CONSUMER_SIGN_FILTER, getConsumerSignFilter) @@ -47,7 +47,6 @@ func (csf *ConsumerSignFilter) Invoke(ctx context.Context, invoker protocol.Invo }) if err != nil { panic(fmt.Sprintf("Sign for invocation %s # %s failed", url.ServiceKey(), invocation.MethodName())) - } return invoker.Invoke(ctx, invocation) } diff --git a/filter/filter_impl/auth/default_authenticator.go b/filter/filter_impl/auth/default_authenticator.go index 7c7131c9cf..5a08b5483f 100644 --- a/filter/filter_impl/auth/default_authenticator.go +++ b/filter/filter_impl/auth/default_authenticator.go @@ -20,9 +20,10 @@ package auth import ( "errors" "fmt" - "github.com/apache/dubbo-go/filter" "strconv" "time" + + "github.com/apache/dubbo-go/filter" ) import ( @@ -38,8 +39,7 @@ func init() { } // DefaultAuthenticator is the default implementation of Authenticator -type DefaultAuthenticator struct { -} +type DefaultAuthenticator struct{} // Sign adds the signature to the invocation func (authenticator *DefaultAuthenticator) Sign(invocation protocol.Invocation, url *common.URL) error { @@ -65,7 +65,6 @@ func (authenticator *DefaultAuthenticator) Sign(invocation protocol.Invocation, // getSignature // get signature by the metadata and params of the invocation func getSignature(url *common.URL, invocation protocol.Invocation, secrectKey string, currentTime string) (string, error) { - requestString := fmt.Sprintf(constant.SIGNATURE_STRING_FORMAT, url.ColonSeparatedKey(), invocation.MethodName(), secrectKey, currentTime) var signature string @@ -125,7 +124,6 @@ func GetDefaultAuthenticator() filter.Authenticator { } func doAuthWork(url *common.URL, do func(filter.Authenticator) error) error { - shouldAuth := url.GetParamBool(constant.SERVICE_AUTH_KEY, false) if shouldAuth { authenticator := extension.GetAuthenticator(url.GetParam(constant.AUTHENTICATOR_KEY, constant.DEFAULT_AUTHENTICATOR)) diff --git a/filter/filter_impl/auth/default_authenticator_test.go b/filter/filter_impl/auth/default_authenticator_test.go index d915b6a16e..c253caf157 100644 --- a/filter/filter_impl/auth/default_authenticator_test.go +++ b/filter/filter_impl/auth/default_authenticator_test.go @@ -50,7 +50,7 @@ func TestDefaultAuthenticator_Authenticate(t *testing.T) { requestTime := strconv.Itoa(int(time.Now().Unix() * 1000)) signature, _ := getSignature(testurl, inv, secret, requestTime) - var authenticator = &DefaultAuthenticator{} + authenticator := &DefaultAuthenticator{} invcation := invocation.NewRPCInvocation("test", parmas, map[string]interface{}{ constant.REQUEST_SIGNATURE_KEY: signature, @@ -69,7 +69,6 @@ func TestDefaultAuthenticator_Authenticate(t *testing.T) { }) err = authenticator.Authenticate(invcation, testurl) assert.NotNil(t, err) - } func TestDefaultAuthenticator_Sign(t *testing.T) { @@ -84,7 +83,6 @@ func TestDefaultAuthenticator_Sign(t *testing.T) { assert.NotEqual(t, inv.AttachmentsByKey(constant.CONSUMER, ""), "") assert.NotEqual(t, inv.AttachmentsByKey(constant.REQUEST_TIMESTAMP_KEY, ""), "") assert.Equal(t, inv.AttachmentsByKey(constant.AK_KEY, ""), "akey") - } func Test_getAccessKeyPairSuccess(t *testing.T) { @@ -114,7 +112,6 @@ func Test_getAccessKeyPairFailed(t *testing.T) { common.WithParamsValue(constant.ACCESS_KEY_ID_KEY, "akey"), common.WithParamsValue(constant.ACCESS_KEY_STORAGE_KEY, "dubbo")) _, e = getAccessKeyPair(invcation, testurl) assert.NoError(t, e) - } func Test_getSignatureWithinParams(t *testing.T) { diff --git a/filter/filter_impl/auth/provider_auth.go b/filter/filter_impl/auth/provider_auth.go index 774fdb2fb8..9a6490db0e 100644 --- a/filter/filter_impl/auth/provider_auth.go +++ b/filter/filter_impl/auth/provider_auth.go @@ -30,8 +30,7 @@ import ( ) // ProviderAuthFilter verifies the correctness of the signature on provider side -type ProviderAuthFilter struct { -} +type ProviderAuthFilter struct{} func init() { extension.SetFilter(constant.PROVIDER_AUTH_FILTER, getProviderAuthFilter) diff --git a/filter/filter_impl/auth/provider_auth_test.go b/filter/filter_impl/auth/provider_auth_test.go index dc130b5985..9e68b645f7 100644 --- a/filter/filter_impl/auth/provider_auth_test.go +++ b/filter/filter_impl/auth/provider_auth_test.go @@ -70,5 +70,4 @@ func TestProviderAuthFilter_Invoke(t *testing.T) { assert.Equal(t, result, filter.Invoke(context.Background(), invoker, inv)) url.SetParam(constant.SERVICE_AUTH_KEY, "true") assert.Equal(t, result, filter.Invoke(context.Background(), invoker, inv)) - } diff --git a/filter/filter_impl/auth/sign_util_test.go b/filter/filter_impl/auth/sign_util_test.go index a4aaf2da27..69203e6f3b 100644 --- a/filter/filter_impl/auth/sign_util_test.go +++ b/filter/filter_impl/auth/sign_util_test.go @@ -56,7 +56,6 @@ func TestSign(t *testing.T) { key := "key" signature := Sign(metadata, key) assert.NotNil(t, signature) - } func TestSignWithParams(t *testing.T) { diff --git a/filter/filter_impl/execute_limit_filter.go b/filter/filter_impl/execute_limit_filter.go index 35611611c8..fdd472c485 100644 --- a/filter/filter_impl/execute_limit_filter.go +++ b/filter/filter_impl/execute_limit_filter.go @@ -134,8 +134,10 @@ func (state *ExecuteState) decrease() { atomic.AddInt64(&state.concurrentCount, -1) } -var executeLimitOnce sync.Once -var executeLimitFilter *ExecuteLimitFilter +var ( + executeLimitOnce sync.Once + executeLimitFilter *ExecuteLimitFilter +) // GetExecuteLimitFilter returns the singleton ExecuteLimitFilter instance func GetExecuteLimitFilter() filter.Filter { diff --git a/filter/filter_impl/generic_filter.go b/filter/filter_impl/generic_filter.go index cf307d0ad8..f184bd37b0 100644 --- a/filter/filter_impl/generic_filter.go +++ b/filter/filter_impl/generic_filter.go @@ -38,7 +38,7 @@ import ( const ( // GENERIC - //generic module name + // generic module name GENERIC = "generic" ) @@ -115,14 +115,14 @@ func struct2MapAll(obj interface{}) interface{} { return result } else if t.Kind() == reflect.Slice { value := reflect.ValueOf(obj) - var newTemps = make([]interface{}, 0, value.Len()) + newTemps := make([]interface{}, 0, value.Len()) for i := 0; i < value.Len(); i++ { newTemp := struct2MapAll(value.Index(i).Interface()) newTemps = append(newTemps, newTemp) } return newTemps } else if t.Kind() == reflect.Map { - var newTempMap = make(map[interface{}]interface{}, v.Len()) + newTempMap := make(map[interface{}]interface{}, v.Len()) iter := v.MapRange() for iter.Next() { if !iter.Value().CanInterface() { diff --git a/filter/filter_impl/generic_service_filter_test.go b/filter/filter_impl/generic_service_filter_test.go index c755a2d280..6b80d2168c 100644 --- a/filter/filter_impl/generic_service_filter_test.go +++ b/filter/filter_impl/generic_service_filter_test.go @@ -93,7 +93,8 @@ func TestGenericServiceFilterInvoke(t *testing.T) { hessian.Object(append(make([]map[string]interface{}, 1), m)), hessian.Object("111"), hessian.Object(append(make([]map[string]interface{}, 1), m)), - hessian.Object("222")}, + hessian.Object("222"), + }, } s := &TestService{} _, _ = common.ServiceMap.Register("com.test.Path", "testprotocol", "", "", s) diff --git a/filter/filter_impl/graceful_shutdown_filter.go b/filter/filter_impl/graceful_shutdown_filter.go index 4a4e8ce466..f79123c8f2 100644 --- a/filter/filter_impl/graceful_shutdown_filter.go +++ b/filter/filter_impl/graceful_shutdown_filter.go @@ -32,10 +32,10 @@ import ( ) func init() { - var consumerFiler = &gracefulShutdownFilter{ + consumerFiler := &gracefulShutdownFilter{ shutdownConfig: config.GetConsumerConfig().ShutdownConfig, } - var providerFilter = &gracefulShutdownFilter{ + providerFilter := &gracefulShutdownFilter{ shutdownConfig: config.GetProviderConfig().ShutdownConfig, } diff --git a/filter/filter_impl/graceful_shutdown_filter_test.go b/filter/filter_impl/graceful_shutdown_filter_test.go index b16956e01c..870c808a34 100644 --- a/filter/filter_impl/graceful_shutdown_filter_test.go +++ b/filter/filter_impl/graceful_shutdown_filter_test.go @@ -72,5 +72,4 @@ func TestGenericFilterInvoke(t *testing.T) { }) assert.True(t, providerConfig.ShutdownConfig.RequestsFinished) assert.Equal(t, rejectHandler, shutdownFilter.getRejectHandler()) - } diff --git a/filter/filter_impl/hystrix_filter.go b/filter/filter_impl/hystrix_filter.go index d13e02c06f..3a7c0c4829 100644 --- a/filter/filter_impl/hystrix_filter.go +++ b/filter/filter_impl/hystrix_filter.go @@ -23,11 +23,13 @@ import ( "regexp" "sync" ) + import ( "github.com/afex/hystrix-go/hystrix" perrors "github.com/pkg/errors" "gopkg.in/yaml.v2" ) + import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" @@ -123,7 +125,7 @@ func NewHystrixFilterError(err error, failByHystrix bool) error { * "GetUser1": "userp_m" */ type HystrixFilter struct { - COrP bool //true for consumer + COrP bool // true for consumer res map[string][]*regexp.Regexp ifNewMap sync.Map } @@ -179,7 +181,7 @@ func (hf *HystrixFilter) Invoke(ctx context.Context, invoker protocol.Invoker, i } return err }, func(err error) error { - //Return error and if it is caused by hystrix logic, so that it can be handled by previous filters. + // Return error and if it is caused by hystrix logic, so that it can be handled by previous filters. _, ok := err.(hystrix.CircuitError) logger.Debugf("[Hystrix Filter]Hystrix health check counted, error is: %v, failed by hystrix: %v; %s", err, ok, cmdName) result = &protocol.RPCResult{} @@ -197,7 +199,7 @@ func (hf *HystrixFilter) OnResponse(ctx context.Context, result protocol.Result, // GetHystrixFilterConsumer returns HystrixFilter instance for consumer func GetHystrixFilterConsumer() filter.Filter { - //When first called, load the config in + // When first called, load the config in consumerConfigOnce.Do(func() { if err := initHystrixConfigConsumer(); err != nil { logger.Warnf("[Hystrix Filter]Config load failed for consumer, error is: %v , will use default", err) @@ -217,7 +219,7 @@ func GetHystrixFilterProvider() filter.Filter { } func getConfig(service string, method string, cOrP bool) CommandConfigWithError { - //Find method level config + // Find method level config var conf *HystrixFilterConfig if cOrP { conf = confConsumer @@ -229,13 +231,13 @@ func getConfig(service string, method string, cOrP bool) CommandConfigWithError logger.Infof("[Hystrix Filter]Found method-level config for %s - %s", service, method) return *getConf } - //Find service level config + // Find service level config getConf = conf.Configs[conf.Services[service].ServiceConfig] if getConf != nil { logger.Infof("[Hystrix Filter]Found service-level config for %s - %s", service, method) return *getConf } - //Find default config + // Find default config getConf = conf.Configs[conf.Default] if getConf != nil { logger.Infof("[Hystrix Filter]Found global default config for %s - %s", service, method) @@ -244,7 +246,6 @@ func getConfig(service string, method string, cOrP bool) CommandConfigWithError getConf = &CommandConfigWithError{} logger.Infof("[Hystrix Filter]No config found for %s - %s, using default", service, method) return *getConf - } func initHystrixConfigConsumer() error { diff --git a/filter/filter_impl/hystrix_filter_test.go b/filter/filter_impl/hystrix_filter_test.go index 4973ce7f70..8bf72636df 100644 --- a/filter/filter_impl/hystrix_filter_test.go +++ b/filter/filter_impl/hystrix_filter_test.go @@ -47,7 +47,7 @@ func TestNewHystrixFilterError(t *testing.T) { } func mockInitHystrixConfig() { - //Mock config + // Mock config confConsumer = &HystrixFilterConfig{ make(map[string]*CommandConfigWithError), "Default", @@ -85,7 +85,6 @@ func mockInitHystrixConfig() { "GetUser": "userp_m", }, } - } func TestGetHystrixFilter(t *testing.T) { @@ -117,7 +116,7 @@ func TestGetConfig2(t *testing.T) { func TestGetConfig3(t *testing.T) { mockInitHystrixConfig() - //This should use default + // This should use default configGot := getConfig("Mock.Service", "GetMock", true) assert.NotNil(t, configGot) assert.Equal(t, 1000, configGot.Timeout) @@ -186,7 +185,7 @@ func TestHystricFilterInvokeCircuitBreak(t *testing.T) { resChan <- result }() } - //This can not always pass the test when on travis due to concurrency, you can uncomment the code below and test it locally + // This can not always pass the test when on travis due to concurrency, you can uncomment the code below and test it locally //var lastRest bool //for i := 0; i < 50; i++ { @@ -195,7 +194,6 @@ func TestHystricFilterInvokeCircuitBreak(t *testing.T) { //Normally the last result should be true, which means the circuit has been opened // //assert.True(t, lastRest) - } func TestHystricFilterInvokeCircuitBreakOmitException(t *testing.T) { @@ -215,7 +213,7 @@ func TestHystricFilterInvokeCircuitBreakOmitException(t *testing.T) { resChan <- result }() } - //This can not always pass the test when on travis due to concurrency, you can uncomment the code below and test it locally + // This can not always pass the test when on travis due to concurrency, you can uncomment the code below and test it locally //time.Sleep(time.Second * 6) //var lastRest bool @@ -224,7 +222,6 @@ func TestHystricFilterInvokeCircuitBreakOmitException(t *testing.T) { //} // //assert.False(t, lastRest) - } func TestGetHystrixFilterConsumer(t *testing.T) { diff --git a/filter/filter_impl/metrics_filter.go b/filter/filter_impl/metrics_filter.go index f4734172b7..27eddfdd06 100644 --- a/filter/filter_impl/metrics_filter.go +++ b/filter/filter_impl/metrics_filter.go @@ -34,9 +34,7 @@ const ( metricFilterName = "metrics" ) -var ( - metricFilterInstance filter.Filter -) +var metricFilterInstance filter.Filter // must initialized before using the filter and after loading configuration func init() { diff --git a/filter/filter_impl/metrics_filter_test.go b/filter/filter_impl/metrics_filter_test.go index ac10d52cf3..98fe129532 100644 --- a/filter/filter_impl/metrics_filter_test.go +++ b/filter/filter_impl/metrics_filter_test.go @@ -39,7 +39,6 @@ import ( ) func TestMetricsFilterInvoke(t *testing.T) { - // prepare the mock reporter config.GetMetricConfig().Reporters = []string{"mock"} mk := &mockReporter{} diff --git a/filter/filter_impl/sentinel_filter.go b/filter/filter_impl/sentinel_filter.go index 1de27adbac..cbe1c38741 100644 --- a/filter/filter_impl/sentinel_filter.go +++ b/filter/filter_impl/sentinel_filter.go @@ -186,9 +186,11 @@ type DubboFallback func(context.Context, protocol.Invoker, protocol.Invocation, func SetDubboConsumerFallback(f DubboFallback) { sentinelDubboConsumerFallback = f } + func SetDubboProviderFallback(f DubboFallback) { sentinelDubboProviderFallback = f } + func getDefaultDubboFallback() DubboFallback { return func(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, blockError *base.BlockError) protocol.Result { result := &protocol.RPCResult{} diff --git a/filter/filter_impl/sentinel_filter_test.go b/filter/filter_impl/sentinel_filter_test.go index c6b6d4280f..ee0f0be13d 100644 --- a/filter/filter_impl/sentinel_filter_test.go +++ b/filter/filter_impl/sentinel_filter_test.go @@ -51,7 +51,7 @@ func TestSentinelFilter_QPS(t *testing.T) { _, err = flow.LoadRules([]*flow.Rule{ { Resource: interfaceResourceName, - //MetricType: flow.QPS, + // MetricType: flow.QPS, TokenCalculateStrategy: flow.Direct, ControlBehavior: flow.Reject, Threshold: 100, 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 d495e035de..e992ece44f 100644 --- a/filter/filter_impl/tps/tps_limit_fix_window_strategy.go +++ b/filter/filter_impl/tps/tps_limit_fix_window_strategy.go @@ -68,7 +68,6 @@ type FixedWindowTpsLimitStrategyImpl struct { // IsAllowable determines if the requests over the TPS limit within the interval. // It is not thread-safe. func (impl *FixedWindowTpsLimitStrategyImpl) IsAllowable() bool { - current := time.Now().UnixNano() if impl.timestamp+impl.interval < current { // it's a new window diff --git a/filter/filter_impl/tps/tps_limiter_method_service.go b/filter/filter_impl/tps/tps_limiter_method_service.go index f0c276438b..76d06bd3fd 100644 --- a/filter/filter_impl/tps/tps_limiter_method_service.go +++ b/filter/filter_impl/tps/tps_limiter_method_service.go @@ -121,7 +121,6 @@ type MethodServiceTpsLimiterImpl struct { // This implementation use concurrent map + loadOrStore to make implementation thread-safe // You can image that even multiple threads create limiter, but only one could store the limiter into tpsState func (limiter MethodServiceTpsLimiterImpl) IsAllowable(url *common.URL, invocation protocol.Invocation) bool { - methodConfigPrefix := "methods." + invocation.MethodName() + "." methodLimitRateConfig := url.GetParam(methodConfigPrefix+constant.TPS_LIMIT_RATE_KEY, "") @@ -193,15 +192,16 @@ func getLimitConfig(methodLevelConfig string, // actually there is no method-level configuration, so we use the service-level configuration result, err := strconv.ParseInt(url.GetParam(configKey, defaultVal), 0, 0) - if err != nil { panic(fmt.Sprintf("Cannot parse the configuration %s, please check your configuration!", configKey)) } return result } -var methodServiceTpsLimiterInstance *MethodServiceTpsLimiterImpl -var methodServiceTpsLimiterOnce sync.Once +var ( + methodServiceTpsLimiterInstance *MethodServiceTpsLimiterImpl + methodServiceTpsLimiterOnce sync.Once +) // GetMethodServiceTpsLimiter will return an MethodServiceTpsLimiterImpl instance. func GetMethodServiceTpsLimiter() filter.TpsLimiter { diff --git a/filter/filter_impl/tps/tps_limiter_method_service_test.go b/filter/filter_impl/tps/tps_limiter_method_service_test.go index 5baa70a5bc..cb9578fca7 100644 --- a/filter/filter_impl/tps/tps_limiter_method_service_test.go +++ b/filter/filter_impl/tps/tps_limiter_method_service_test.go @@ -21,6 +21,7 @@ import ( "net/url" "testing" ) + import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" diff --git a/filter/filter_impl/tps_limit_filter.go b/filter/filter_impl/tps_limit_filter.go index ea1e3bc15e..210e1579bb 100644 --- a/filter/filter_impl/tps_limit_filter.go +++ b/filter/filter_impl/tps_limit_filter.go @@ -20,6 +20,7 @@ package filter_impl import ( "context" ) + import ( "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" @@ -53,8 +54,7 @@ func init() { * tps.limit.rejected.handler: "default", # optional, or the name of the implementation * if the value of 'tps.limiter' is nil or empty string, the tps filter will do nothing */ -type TpsLimitFilter struct { -} +type TpsLimitFilter struct{} // Invoke gets the configured limter to impose TPS limiting func (t TpsLimitFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { diff --git a/filter/filter_impl/tps_limit_filter_test.go b/filter/filter_impl/tps_limit_filter_test.go index 55a3a55fab..24f9827ce4 100644 --- a/filter/filter_impl/tps_limit_filter_test.go +++ b/filter/filter_impl/tps_limit_filter_test.go @@ -52,7 +52,6 @@ func TestTpsLimitFilterInvokeWithNoTpsLimiter(t *testing.T) { []interface{}{"OK"}, attch)) assert.Nil(t, result.Error()) assert.Nil(t, result.Result()) - } func TestGenericFilterInvokeWithDefaultTpsLimiter(t *testing.T) { diff --git a/filter/filter_impl/tracing_filter.go b/filter/filter_impl/tracing_filter.go index dcdbe5b30e..8a30c965da 100644 --- a/filter/filter_impl/tracing_filter.go +++ b/filter/filter_impl/tracing_filter.go @@ -50,8 +50,7 @@ var ( // if you wish to using opentracing, please add the this filter into your filter attribute in your configure file. // notice that this could be used in both client-side and server-side. -type tracingFilter struct { -} +type tracingFilter struct{} func (tf *tracingFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { var ( @@ -95,9 +94,7 @@ func (tf *tracingFilter) OnResponse(ctx context.Context, result protocol.Result, return result } -var ( - tracingFilterInstance *tracingFilter -) +var tracingFilterInstance *tracingFilter func newTracingFilter() filter.Filter { if tracingFilterInstance == nil { diff --git a/filter/handler/rejected_execution_handler_only_log.go b/filter/handler/rejected_execution_handler_only_log.go index 5242b5b49e..5277b27530 100644 --- a/filter/handler/rejected_execution_handler_only_log.go +++ b/filter/handler/rejected_execution_handler_only_log.go @@ -18,8 +18,9 @@ package handler import ( - "github.com/apache/dubbo-go/filter" "sync" + + "github.com/apache/dubbo-go/filter" ) import ( @@ -41,8 +42,10 @@ func init() { extension.SetRejectedExecutionHandler(constant.DEFAULT_KEY, GetOnlyLogRejectedExecutionHandler) } -var onlyLogHandlerInstance *OnlyLogRejectedExecutionHandler -var onlyLogHandlerOnce sync.Once +var ( + onlyLogHandlerInstance *OnlyLogRejectedExecutionHandler + onlyLogHandlerOnce sync.Once +) // OnlyLogRejectedExecutionHandler implements the RejectedExecutionHandler /** @@ -59,8 +62,7 @@ var onlyLogHandlerOnce sync.Once * - name: "GetUser" * OnlyLogRejectedExecutionHandler is designed to be singleton */ -type OnlyLogRejectedExecutionHandler struct { -} +type OnlyLogRejectedExecutionHandler struct{} // RejectedExecution will do nothing, it only log the invocation. func (handler *OnlyLogRejectedExecutionHandler) RejectedExecution(url *common.URL, diff --git a/filter/handler/rejected_execution_handler_only_log_test.go b/filter/handler/rejected_execution_handler_only_log_test.go index 7aa4aff936..acc3a1940f 100644 --- a/filter/handler/rejected_execution_handler_only_log_test.go +++ b/filter/handler/rejected_execution_handler_only_log_test.go @@ -21,6 +21,7 @@ import ( "net/url" "testing" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" diff --git a/go.mod b/go.mod index bf59758704..fee215bf35 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,6 @@ require ( github.com/emicklei/go-restful/v3 v3.4.0 github.com/frankban/quicktest v1.4.1 // indirect github.com/fsnotify/fsnotify v1.4.9 - github.com/gin-gonic/gin v1.5.0 // indirect github.com/go-co-op/gocron v0.1.1 github.com/go-resty/resty/v2 v2.3.0 github.com/golang/mock v1.4.4 @@ -31,9 +30,7 @@ require ( github.com/hashicorp/vault/api v1.0.5-0.20191108163347-bdd38fca2cff // indirect github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 - github.com/labstack/echo/v4 v4.1.15 // indirect - github.com/magiconair/properties v1.8.4 - github.com/micro/go-micro/v2 v2.9.1 // indirect + github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.1 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/nacos-group/nacos-sdk-go v1.0.7 diff --git a/go.sum b/go.sum index 684d274952..9e23621ce2 100644 --- a/go.sum +++ b/go.sum @@ -5,36 +5,25 @@ cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3 h1:AVXDdKsrtX33oR9fbCMu/+c1o8Ofjq6Ku/MInaLVg5Y= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0 h1:0E3eE8MX426vUOs7aHfI7aN1BrIzzzf4ccKCSfSjGmc= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v40.3.0+incompatible h1:NthZg3psrLxvQLN6rVm07pZ9mv2wvGNaBNGQ3fnPvLE= github.com/Azure/azure-sdk-for-go v40.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= -github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= github.com/Azure/go-autorest/autorest v0.10.0 h1:mvdtztBqcL8se7MdrUweNieTNi4kfNG6GOJuurQJpuY= github.com/Azure/go-autorest/autorest v0.10.0/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= -github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= @@ -44,15 +33,12 @@ github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= @@ -64,16 +50,12 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.4.3 h1:M3NHMuPgMSUPdE5epwNUHlRPSVzHs8HpRTrVXhR0myo= github.com/Microsoft/go-winio v0.4.3/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c/go.mod h1:7xhjOwRV2+0HXGmM0jxaEu+ZiXJFoVZOTfL/dmqbrD8= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.0.1 h1:iLrQrdwjDd52kHDA5op2UBJFjmOb9g+7scBan4RN8F0= github.com/NYTimes/gziphandler v1.0.1/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/RoaringBitmap/roaring v0.5.5 h1:naNqvO1mNnghk2UvcsqnzHDBn9DRbCIRy94GmDTRVTQ= @@ -90,29 +72,19 @@ github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KM github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k= -github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 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/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alibaba/sentinel-golang v0.6.2/go.mod h1:5jemKdyCQCKVf+quEia53fo9a17OSe+wnl9HX2NbNpc= github.com/alibaba/sentinel-golang v1.0.2 h1:Acopq74hOtZN4MV1v811MQ6QcqPFLDSczTrRXv9zpIg= github.com/alibaba/sentinel-golang v1.0.2/go.mod h1:QsB99f/z35D2AiMrAWwgWE85kDTkBUIkcmPrRt+61NI= -github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/dubbo-getty v1.3.10/go.mod h1:x6rraK01BL5C7jUM2fPl5KMkAxLVIx54ZB8/XEOik9Y= github.com/apache/dubbo-getty v1.4.3 h1:PCKpryDasKOxwT5MBC6MIMO+0NLOaHF6Xco9YXQw7HI= github.com/apache/dubbo-getty v1.4.3/go.mod h1:ansXgKxxyhCOiQL29nO5ce1MDcEKmCyZuNR9oMs3hek= -github.com/apache/dubbo-go v1.5.5/go.mod h1:KAty5L/vcHjh3qcTfC4R5Nfd0tkk7MLJnux/IQKfQLg= github.com/apache/dubbo-go v1.5.6-rc2/go.mod h1:wLJvPWbnrf6/bhoohBT404QK4t2JoNcckMw+/fJ9P+c= -github.com/apache/dubbo-go-hessian2 v1.7.0/go.mod h1:7rEw9guWABQa6Aqb8HeZcsYPHsOS7XT1qtJvkmI6c5w= github.com/apache/dubbo-go-hessian2 v1.9.1 h1:ceSsU/9z/gv3hzUpl8GceEhQvF3i0BionfdHUGMmjHU= github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -127,65 +99,43 @@ github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.41/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0 h1:0xphMHGMLBrPMfxR2AmVjZKcMEESEgWF8Kru94BNByk= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23 h1:D21IyuvjDCshj1/qq+pCNd3VZOAEI9jy6Bi131YlXgI= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= -github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coredns/coredns v1.1.2 h1:bAFHrSsBeTeRG5W3Nf2su3lUGw7Npw2UKeCJm/3A638= github.com/coredns/coredns v1.1.2/go.mod h1:zASH/MVDgR6XZTbxvOnsZfffS+31vg6Ackf/wo1+AM0= github.com/coreos/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.25+incompatible h1:0GQEw6h3YnuOVdtwygkIfJ+Omx0tZ8/QkVyXI4LkbeY= github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -196,16 +146,13 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creasty/defaults v1.5.1 h1:j8WexcS3d/t4ZmllX4GEkl4wIB/trOr035ajcLHCISM= @@ -224,31 +171,20 @@ github.com/digitalocean/godo v1.10.0 h1:uW1/FcvZE/hoixnJcnlmIUvTVNdZCLjRLzmDtRi1 github.com/digitalocean/godo v1.10.0/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dnsimple/dnsimple-go v0.30.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.3.0 h1:3lOnM9cSzgGwx8VfK/NGOW5fLQ0GjIlCkaktF+n1M6o= github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/dubbogo/go-zookeeper v1.0.2/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl83me8g= github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= -github.com/dubbogo/gost v1.9.5/go.mod h1:QNM5RaeRdNWehUu8S0hUP5Qa8QUfGf6KH1JhqOVFvEI= github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI= github.com/dubbogo/gost v1.11.2 h1:NanyHmvzE1HrgI2T9H/jE/N1wkxFEj+IbM1A4RT9H7Q= github.com/dubbogo/gost v1.11.2/go.mod h1:3QQEj50QOhkWTERT785YZ5ZxIRGNdR11FCLP7FzHsMc= github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= github.com/dubbogo/net v0.0.2-0.20210326124702-e6a866993192 h1:CBEicrrVwR6u8ty+kL68ItxXVk1jaVYThrsx5ARhxUc= github.com/dubbogo/net v0.0.2-0.20210326124702-e6a866993192/go.mod h1:B6/ka3g8VzcyrmdCH4VkHP1K0aHeI37FmclS+TCwIBU= -github.com/dubbogo/triple v0.0.0-20210402135031-9aa541d21f6d h1:BhsqRMFaYFnIKtKnJSZsc9xb1tmmOeMUQD+vH73Hj3I= -github.com/dubbogo/triple v0.0.0-20210402135031-9aa541d21f6d/go.mod h1:QEkkIVUHu506i2sdRWfzi/0MSc94+ahtqKMvh8nlwkk= github.com/dubbogo/triple v0.0.0-20210403061850-372f2dc47e02 h1:UBbWY1RWTTuNGUpQgOsvLxgGzNqms1DNEGJqwJ/LE/A= github.com/dubbogo/triple v0.0.0-20210403061850-372f2dc47e02/go.mod h1:ArB/FJCvy6DQXs8tW6LmNRtLaZuncGmDHqD/1JOAwsU= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -258,7 +194,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/ef-ds/deque v1.0.4-0.20190904040645-54cb57c252a1/go.mod h1:HvODWzv6Y6kBf3Ah2WzN1bHjDUezGLaAhwuWVwfpEJs= github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0 h1:ZoRgc53qJCfSLimXqJDrmBhnt5GChDsExMCK7t48o0Y= github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= @@ -268,7 +203,6 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1 github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.4.0 h1:IIDhql3oyWZj1ay2xBZGb4sTOWMad0HVW8rwhVxN/Yk= github.com/emicklei/go-restful/v3 v3.4.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.8.0 h1:uE6Fp4fOcAJdc1wTQXLJ+SYistkbG1dNoi6Zs1+Ybvk= github.com/envoyproxy/go-control-plane v0.8.0/go.mod h1:GSSbY9P1neVhdY7G4wu+IK1rk/dqhiCC/4ExuWJZVuk= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -276,16 +210,12 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrp github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 h1:Ghm4eQYC0nEPnSJdVkTrXpu9KtoVCSo1hg7mtI7G9KU= github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239/go.mod h1:Gdwt2ce0yfBxPvZrHkprdPPTTS3N5rwmLE8T22KBXlw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.4.1 h1:Wv2VwvNn73pAdFIVUQRXYDFp31lXKbqblIXo/Q5GPSg= @@ -293,31 +223,19 @@ github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsouza/go-dockerclient v1.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru1hufTHVb++eG6OuNDKMxZnGIvF6o/u8q/8h2+I4= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-co-op/gocron v0.1.1 h1:OfDmkqkCguFtFMsm6Eaayci3DADLa8pXvdmOlPU/JcU= github.com/go-co-op/gocron v0.1.1/go.mod h1:Y9PWlYqDChf2Nbgg7kfS+ZsXHDTZbMZYPEQ0MILqH+M= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -334,29 +252,20 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0 h1:kFkMAZBNAn4j7K0GiZr8cRYzejq68VbheufiV3YuyFI= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= @@ -374,11 +283,9 @@ github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -426,50 +333,39 @@ github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhp github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gophercloud/gophercloud v0.3.0 h1:6sjpKIpVwRIIwmcEGp+WwNovNsem+c+2vm6oxshRpL8= -github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw= github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= -github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul v1.8.0 h1:yRKMKZyPLqUxl37t4nFt5OuGmTXoFhTJrakhfnYKCYA= github.com/hashicorp/consul v1.8.0/go.mod h1:Gg9/UgAQ9rdY3CTvzQZ6g2jcIb7NlIfjI+0pvLk5D1A= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/api v1.5.0 h1:Yo2bneoGy68A7aNwmuETFnPhjyBEm7n3vzRacEVMjvI= github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/consul/sdk v0.5.0 h1:WC4594Wp/LkEeML/OdQKEC1yqBmEYkRp6i7X5u0zDAs= github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 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-bexpr v0.1.2 h1:ijMXI4qERbzxbCnkxmfUtwMyjrrk3y+Vt0MxojNCbBs= @@ -497,7 +393,6 @@ github.com/hashicorp/go-memdb v1.0.3/go.mod h1:LWQ8R70vPrS4OEY9k28D2z8/Zzyu34NVz github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -532,8 +427,6 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hil v0.0.0-20160711231837-1e86c6b523c5 h1:uk280DXEbQiCOZgCOI3elFSeNxf8YIZiNsbr2pQLYD0= @@ -576,22 +469,17 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgx v3.3.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da h1:FjHUJJ7oBW4G/9j1KzlHaXL09LyMVM9rupS39lncbXk= github.com/jarcoal/httpmock v0.0.0-20180424175123-9c70cfe4a1da/go.mod h1:ks+b9deReOc7jgqp+e7LuFiCBH6Rm5hL32cLcEAArb4= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 h1:mGIXW/lubQ4B+3bXTLxcTMTjUNDqoF6T/HUW9LbFx9s= github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= @@ -608,7 +496,6 @@ github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -620,13 +507,10 @@ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= @@ -639,11 +523,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= -github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= -github.com/labstack/echo/v4 v4.1.15/go.mod h1:GWO5IBVzI371K8XJe50CSvHjQCafK6cw8R/moLhEU6o= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 h1:0iQektZGS248WXmGIYOwRXSQhD4qn3icjMpuxwO7qlo= github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE= github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f h1:sgUSP4zdTUZYZgAGGtN5Lxk92rK+JUFOwf+FT99EEI4= @@ -651,25 +530,17 @@ github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 h1:Bvq8AziQ5jFF4BHGAEDSqwPW1NJS3XshxbRCxtjFAZc= github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linode/linodego v0.7.1 h1:4WZmMpSA2NRwlPZcc0+4Gyn7rr99Evk9bnr0B3gXRKE= github.com/linode/linodego v0.7.1/go.mod h1:ga11n3ivecUrPCHN0rANxKmfWBJVkOXfLMZinAbj2sY= -github.com/linode/linodego v0.10.0 h1:AMdb82HVgY8o3mjBXJcUv9B+fnJjfDMn2rNRGbX+jvM= -github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA= -github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ= -github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgVpFfizUfW5WMaqyU= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= -github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= @@ -677,25 +548,17 @@ github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/micro/cli/v2 v2.1.2/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= -github.com/micro/go-micro/v2 v2.9.1/go.mod h1:x55ZM3Puy0FyvvkR3e0ha0xsE9DFwfPSUMWAIbFY0SY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM= -github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0 h1:tEElEatulEHDeedTxwckzyYMA5c86fbmNIUL1hBIiTg= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= @@ -708,18 +571,14 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.0 h1:/x0XQ6h+3U3nAyk1yx+bHPURrKa9sVVvYbuqZ7pIAtI= github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 h1:hOY53G+kBFhbYFpRVxHl5eS7laP6B1+Cq+Z9Dry1iMU= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.0.0 h1:ATSdz4NWrmWPOF1CeCBU4sMCno2hgqdbSrRPFWQSVZI= @@ -734,44 +593,30 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nacos-group/nacos-sdk-go v1.0.0/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= -github.com/nacos-group/nacos-sdk-go v1.0.1/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= github.com/nacos-group/nacos-sdk-go v1.0.7 h1:Am1tJFe7GUTNCREKsZ5ok0H2OspHDRmRcsxn7DiSwhA= github.com/nacos-group/nacos-sdk-go v1.0.7/go.mod h1:hlAPn3UdzlxIlSILAyOXKxjFSvDJ9oLzTJ9hLAK1KzA= -github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.1.6/go.mod h1:BL1NOtaBQ5/y97djERRVWNouMW7GT3gxnmbE/eC8u8A= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.9.2/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= -github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= -github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= -github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ= -github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.0-20180130162743-b8a9be070da4/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -784,13 +629,6 @@ github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -801,9 +639,6 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= -github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c h1:vwpFWvAO8DeIZfFeqASzZfsxuWPno9ncAebBEP0N3uE= github.com/packethost/packngo v0.1.1-0.20180711074735-b9cb5096f54c/go.mod h1:otzZQXgoO96RTzDB/Hycg0qZcXZsWJGJRSXbmEIJ+4M= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -842,10 +677,8 @@ github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4 github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -859,10 +692,8 @@ github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7q github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -870,14 +701,11 @@ github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA= github.com/rboyer/safeio v0.2.1/go.mod h1:Cq/cEPK+YXFn622lsQ0K4KsPZSPtaptHHEldsy7Fmig= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/renier/xmlrpc v0.0.0-20170708154548-ce4a1a486c03 h1:Wdi9nwnhFNAlseAOekn6B5G/+GMtks9UKbvRU/CMM/o= @@ -892,7 +720,6 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= @@ -901,7 +728,6 @@ github.com/sean-/conswriter v0.0.0-20180208195008-f5ae3917a627/go.mod h1:7zjs06q github.com/sean-/pager v0.0.0-20180208200047-666be9bf53b5/go.mod h1:BeybITEsBEg6qbIiqJ6/Bqeq25bCLbL7YFmpaFfJDuM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880 h1:1Ge4j/3uB2rxzPWD3TC+daeCw+w91z8UCUL/7WH5gn8= github.com/shirou/gopsutil v0.0.0-20181107111621-48177ef5f880/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= @@ -910,11 +736,9 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -963,49 +787,31 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tebeka/strftime v0.1.3 h1:5HQXOqWKYRFfNyBMNVc9z5+QzuBtIXy03psIhtdJYto= github.com/tebeka/strftime v0.1.3/go.mod h1:7wJm3dZlpr4l/oVK0t1HYIc4rMzQ2XJlOMIUJUJH6XQ= -github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible h1:8uRvJleFpqLsO77WaAh2UrasMOzd8MxXrNj20e7El+Q= github.com/tencentcloud/tencentcloud-sdk-go v3.0.83+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9/go.mod h1:RHkNRtSLfOK7qBTHaeSX1D6BNpI3qw7NTxsmNr4RvN8= github.com/tevid/gohamcrest v1.1.1 h1:ou+xSqlIw1xfGTg1uq1nif/htZ2S3EzRqLm2BP+tYU0= github.com/tevid/gohamcrest v1.1.1/go.mod h1:3UvtWlqm8j5JbwYZh80D/PVBt0mJ1eJiYgZMibh0H/k= -github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3 h1:kF/7m/ZU+0D4Jj5eZ41Zm3IH/J8OElK1Qtd7tVKAwLk= github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE= -github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/vmware/govmomi v0.18.0 h1:f7QxSmP7meCtoAmiKZogvVbLInT+CZx6Px6K5rYsJZo= github.com/vmware/govmomi v0.18.0/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= -github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= github.com/willf/bitset v1.1.10 h1:NotGKqX0KwQ72NUzqrjZq5ipPNDQex9lo3WpaS8L2sc= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1034,7 +840,6 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1042,29 +847,20 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1072,7 +868,6 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1082,7 +877,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -1095,7 +889,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1106,7 +899,6 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1115,17 +907,12 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= @@ -1147,7 +934,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1159,7 +945,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1168,17 +953,13 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1191,14 +972,11 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo= @@ -1214,7 +992,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1241,13 +1018,9 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200928182047-19e03678916f/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= @@ -1264,9 +1037,6 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0 h1:uMf5uLi4eQMRrMKhCplNik4U4H8Z6C1br3zOtAa/aDE= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1274,7 +1044,6 @@ google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1285,7 +1054,6 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884 h1:fiNLklpBwWK1mth30Hlwk+fcdBmIALlgF5iy77O37Ig= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1320,23 +1088,16 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw= -gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.4.1 h1:H0TmLt7/KmzlrDOpa1F+zr0Tk90PbJYBfsVUmRLrf9Y= gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/telegram-bot-api.v4 v4.6.4/go.mod h1:5DpGO5dbumb40px+dXcwCpcjmeHNYLpk0bp3XRNvWDM= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= @@ -1376,7 +1137,6 @@ k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJD k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= diff --git a/metadata/definition/mock.go b/metadata/definition/mock.go index ca9e125a74..02f969c6c6 100644 --- a/metadata/definition/mock.go +++ b/metadata/definition/mock.go @@ -29,8 +29,7 @@ type User struct { Time time.Time } -type UserProvider struct { -} +type UserProvider struct{} func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error) { rsp := User{"A001", "Alex Stocks", 18, time.Now()} diff --git a/metadata/identifier/base_metadata_identifier.go b/metadata/identifier/base_metadata_identifier.go index 2371f7ca02..47c2e938ce 100644 --- a/metadata/identifier/base_metadata_identifier.go +++ b/metadata/identifier/base_metadata_identifier.go @@ -68,7 +68,6 @@ func (mdi *BaseMetadataIdentifier) getFilePathKey(params ...string) string { withPathSeparator(mdi.Group) + withPathSeparator(mdi.Side) + joinParams(constant.PATH_SEPARATOR, params) - } // serviceToPath uss URL encode to decode the @serviceInterface @@ -82,7 +81,6 @@ func serviceToPath(serviceInterface string) string { } return string(decoded) } - } // withPathSeparator return "/" + @path diff --git a/metadata/mapping/dynamic/service_name_mapping_test.go b/metadata/mapping/dynamic/service_name_mapping_test.go index af21704b69..d98a893f67 100644 --- a/metadata/mapping/dynamic/service_name_mapping_test.go +++ b/metadata/mapping/dynamic/service_name_mapping_test.go @@ -33,7 +33,6 @@ import ( ) func TestDynamicConfigurationServiceNameMapping(t *testing.T) { - // mock data appName := "myApp" dc, err := (&config_center.MockDynamicConfigurationFactory{ diff --git a/metadata/mapping/memory/service_name_mapping.go b/metadata/mapping/memory/service_name_mapping.go index 0965d52d91..8017ec794b 100644 --- a/metadata/mapping/memory/service_name_mapping.go +++ b/metadata/mapping/memory/service_name_mapping.go @@ -24,6 +24,7 @@ import ( import ( gxset "github.com/dubbogo/gost/container/set" ) + import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/config" @@ -44,8 +45,10 @@ func (i *InMemoryServiceNameMapping) Get(serviceInterface string, group string, return gxset.NewSet(config.GetApplicationConfig().Name), nil } -var serviceNameMappingInstance *InMemoryServiceNameMapping -var serviceNameMappingOnce sync.Once +var ( + serviceNameMappingInstance *InMemoryServiceNameMapping + serviceNameMappingOnce sync.Once +) func GetNameMappingInstance() mapping.ServiceNameMapping { serviceNameMappingOnce.Do(func() { diff --git a/metadata/report/consul/report.go b/metadata/report/consul/report.go index e211f7fde4..0c9f9cb7c9 100644 --- a/metadata/report/consul/report.go +++ b/metadata/report/consul/report.go @@ -29,9 +29,7 @@ import ( "github.com/apache/dubbo-go/metadata/report/factory" ) -var ( - emptyStrSlice = make([]string, 0) -) +var emptyStrSlice = make([]string, 0) func init() { mf := &consulMetadataReportFactory{} @@ -111,8 +109,7 @@ func (m *consulMetadataReport) GetServiceDefinition(metadataIdentifier *identifi return string(kv.Value), nil } -type consulMetadataReportFactory struct { -} +type consulMetadataReportFactory struct{} // nolint func (mf *consulMetadataReportFactory) CreateMetadataReport(url *common.URL) report.MetadataReport { diff --git a/metadata/report/delegate/delegate_report.go b/metadata/report/delegate/delegate_report.go index 56a22de8f8..2cd9af8fec 100644 --- a/metadata/report/delegate/delegate_report.go +++ b/metadata/report/delegate/delegate_report.go @@ -125,7 +125,6 @@ func NewMetadataReport() (*MetadataReport, error) { url.GetParamInt(constant.RETRY_TIMES_KEY, defaultMetadataReportRetryTimes), bmr.retry, ) - if err != nil { return nil, err } @@ -139,7 +138,6 @@ func NewMetadataReport() (*MetadataReport, error) { bmr.allMetadataReportsLock.RLock() bmr.doHandlerMetadataCollection(bmr.allMetadataReports) bmr.allMetadataReportsLock.RUnlock() - }) if err != nil { return nil, err diff --git a/metadata/report/delegate/delegate_report_test.go b/metadata/report/delegate/delegate_report_test.go index f60acf6e11..f2c7376f34 100644 --- a/metadata/report/delegate/delegate_report_test.go +++ b/metadata/report/delegate/delegate_report_test.go @@ -87,7 +87,7 @@ func mockNewMetadataReport(t *testing.T) *MetadataReport { func TestMetadataReport_StoreProviderMetadata(t *testing.T) { mtr := mockNewMetadataReport(t) - var metadataId = &identifier.MetadataIdentifier{ + metadataId := &identifier.MetadataIdentifier{ Application: "app", BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{ ServiceInterface: "com.ikurento.user.UserProvider", diff --git a/metadata/report/etcd/report_test.go b/metadata/report/etcd/report_test.go index 59d0975ca6..536149492b 100644 --- a/metadata/report/etcd/report_test.go +++ b/metadata/report/etcd/report_test.go @@ -105,7 +105,6 @@ func newSubscribeMetadataIdentifier() *identifier.SubscriberMetadataIdentifier { Revision: "subscribe", MetadataIdentifier: *newMetadataIdentifier("provider"), } - } func newServiceMetadataIdentifier() *identifier.ServiceMetadataIdentifier { diff --git a/metadata/report/factory/report_factory.go b/metadata/report/factory/report_factory.go index 9f00007cef..df2cf74a83 100644 --- a/metadata/report/factory/report_factory.go +++ b/metadata/report/factory/report_factory.go @@ -27,5 +27,4 @@ type MetadataReportFactory interface { CreateMetadataReport(*common.URL) report.MetadataReport } -type BaseMetadataReportFactory struct { -} +type BaseMetadataReportFactory struct{} diff --git a/metadata/report/nacos/report.go b/metadata/report/nacos/report.go index 42e9859c9f..f62d02fffb 100644 --- a/metadata/report/nacos/report.go +++ b/metadata/report/nacos/report.go @@ -173,8 +173,7 @@ func (n *nacosMetadataReport) getConfig(param vo.ConfigParam) (string, error) { return cfg, nil } -type nacosMetadataReportFactory struct { -} +type nacosMetadataReportFactory struct{} // nolint func (n *nacosMetadataReportFactory) CreateMetadataReport(url *common.URL) report.MetadataReport { diff --git a/metadata/report/zookeeper/report.go b/metadata/report/zookeeper/report.go index 472f50a3eb..580be9151a 100644 --- a/metadata/report/zookeeper/report.go +++ b/metadata/report/zookeeper/report.go @@ -35,9 +35,7 @@ import ( "github.com/apache/dubbo-go/metadata/report/factory" ) -var ( - emptyStrSlice = make([]string, 0) -) +var emptyStrSlice = make([]string, 0) func init() { mf := &zookeeperMetadataReportFactory{} @@ -110,8 +108,7 @@ func (m *zookeeperMetadataReport) GetServiceDefinition(metadataIdentifier *ident return string(v), err } -type zookeeperMetadataReportFactory struct { -} +type zookeeperMetadataReportFactory struct{} // nolint func (mf *zookeeperMetadataReportFactory) CreateMetadataReport(url *common.URL) report.MetadataReport { diff --git a/metadata/service/exporter/configurable/exporter_test.go b/metadata/service/exporter/configurable/exporter_test.go index 7c2baa2728..9b2c8e4bec 100644 --- a/metadata/service/exporter/configurable/exporter_test.go +++ b/metadata/service/exporter/configurable/exporter_test.go @@ -52,7 +52,8 @@ func TestConfigurableExporter(t *testing.T) { WaitTimeout: "1s", MaxMsgLen: 10240000000, SessionName: "server", - }}) + }, + }) mockInitProviderWithSingleRegistry() metadataService, _ := inmemory.NewMetadataService() exported := NewMetadataServiceExporter(metadataService) @@ -86,7 +87,8 @@ func mockInitProviderWithSingleRegistry() { Module: "module", Version: "1.0.0", Owner: "dubbo", - Environment: "test"}, + Environment: "test", + }, }, Registry: &config.RegistryConfig{ diff --git a/metadata/service/inmemory/metadata_service_proxy_factory_test.go b/metadata/service/inmemory/metadata_service_proxy_factory_test.go index f5e519cd5d..5f62035328 100644 --- a/metadata/service/inmemory/metadata_service_proxy_factory_test.go +++ b/metadata/service/inmemory/metadata_service_proxy_factory_test.go @@ -63,8 +63,7 @@ func TestCreateProxy(t *testing.T) { assert.NotNil(t, pxy) } -type mockProtocol struct { -} +type mockProtocol struct{} func (m mockProtocol) Export(protocol.Invoker) protocol.Exporter { panic("implement me") @@ -78,8 +77,7 @@ func (m mockProtocol) Destroy() { panic("implement me") } -type mockInvoker struct { -} +type mockInvoker struct{} func (m *mockInvoker) GetUrl() *common.URL { panic("implement me") diff --git a/metadata/service/inmemory/service_proxy.go b/metadata/service/inmemory/service_proxy.go index 8b93aab9ac..fadf998b30 100644 --- a/metadata/service/inmemory/service_proxy.go +++ b/metadata/service/inmemory/service_proxy.go @@ -40,11 +40,10 @@ import ( // for now, only GetExportedURLs need to be implemented type MetadataServiceProxy struct { invkr protocol.Invoker - //golangServer bool + // golangServer bool } func (m *MetadataServiceProxy) GetExportedURLs(serviceInterface string, group string, version string, protocol string) ([]interface{}, error) { - siV := reflect.ValueOf(serviceInterface) gV := reflect.ValueOf(group) vV := reflect.ValueOf(version) diff --git a/metadata/service/inmemory/service_proxy_test.go b/metadata/service/inmemory/service_proxy_test.go index 9278fd9d6c..c697faf04c 100644 --- a/metadata/service/inmemory/service_proxy_test.go +++ b/metadata/service/inmemory/service_proxy_test.go @@ -35,13 +35,11 @@ import ( ) func TestMetadataServiceProxy_GetExportedURLs(t *testing.T) { - pxy := createPxy() assert.NotNil(t, pxy) res, err := pxy.GetExportedURLs(constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE) assert.Nil(t, err) assert.Len(t, res, 1) - } // TestNewMetadataService: those methods are not implemented diff --git a/metadata/service/remote/service.go b/metadata/service/remote/service.go index e2a7a64d53..95e5c7f4df 100644 --- a/metadata/service/remote/service.go +++ b/metadata/service/remote/service.go @@ -109,7 +109,7 @@ func (mts *MetadataService) SubscribeURL(url *common.URL) (bool, error) { func (mts *MetadataService) UnsubscribeURL(url *common.URL) error { // TODO remove call local. return nil - //return mts.UnsubscribeURL(url) + // return mts.UnsubscribeURL(url) } // PublishServiceDefinition will call remote metadata's StoreProviderMetadata to store url info and service definition diff --git a/metadata/service/remote/service_proxy.go b/metadata/service/remote/service_proxy.go index e0cd6e0783..241b3fc01a 100644 --- a/metadata/service/remote/service_proxy.go +++ b/metadata/service/remote/service_proxy.go @@ -20,6 +20,7 @@ package remote import ( "strings" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" @@ -81,7 +82,6 @@ func (m *metadataServiceProxy) GetExportedURLs(serviceInterface string, group st Revision: m.revision, Protocol: protocol, }) - if err != nil { return []interface{}{}, nil } diff --git a/metadata/service/remote/service_proxy_test.go b/metadata/service/remote/service_proxy_test.go index 1899d02205..6edbab5cb6 100644 --- a/metadata/service/remote/service_proxy_test.go +++ b/metadata/service/remote/service_proxy_test.go @@ -20,6 +20,7 @@ package remote import ( "testing" ) + import ( "github.com/stretchr/testify/assert" ) @@ -79,7 +80,6 @@ func TestMetadataServiceProxy(t *testing.T) { } func createProxy() service.MetadataService { - prepareTest() ins := ®istry.DefaultServiceInstance{ @@ -102,15 +102,13 @@ func prepareTest() { instance.GetMetadataReportInstance(u) } -type mockMetadataReportFactory struct { -} +type mockMetadataReportFactory struct{} func (m *mockMetadataReportFactory) CreateMetadataReport(*common.URL) report.MetadataReport { return &mockMetadataReport{} } -type mockMetadataReport struct { -} +type mockMetadataReport struct{} func (m mockMetadataReport) StoreProviderMetadata(*identifier.MetadataIdentifier, string) error { panic("implement me") diff --git a/metadata/service/remote/service_test.go b/metadata/service/remote/service_test.go index d6028152cc..d9e4d1477b 100644 --- a/metadata/service/remote/service_test.go +++ b/metadata/service/remote/service_test.go @@ -47,15 +47,13 @@ func getMetadataReportFactory() factory.MetadataReportFactory { return &metadataReportFactory{} } -type metadataReportFactory struct { -} +type metadataReportFactory struct{} func (mrf *metadataReportFactory) CreateMetadataReport(*common.URL) report.MetadataReport { return &metadataReport{} } -type metadataReport struct { -} +type metadataReport struct{} func (metadataReport) StoreProviderMetadata(*identifier.MetadataIdentifier, string) error { return nil diff --git a/protocol/dubbo/dubbo_codec.go b/protocol/dubbo/dubbo_codec.go index 21376c3145..6c367c7469 100644 --- a/protocol/dubbo/dubbo_codec.go +++ b/protocol/dubbo/dubbo_codec.go @@ -36,7 +36,7 @@ import ( "github.com/apache/dubbo-go/remoting" ) -//SerialID serial ID +// SerialID serial ID type SerialID byte func init() { @@ -46,8 +46,7 @@ func init() { } // DubboCodec. It is implements remoting.Codec -type DubboCodec struct { -} +type DubboCodec struct{} // encode request for transport func (c *DubboCodec) EncodeRequest(request *remoting.Request) (*bytes.Buffer, error) { @@ -129,7 +128,7 @@ func (c *DubboCodec) encodeHeartbeartReqeust(request *remoting.Request) (*bytes. // encode response func (c *DubboCodec) EncodeResponse(response *remoting.Response) (*bytes.Buffer, error) { - var ptype = impl.PackageResponse + ptype := impl.PackageResponse if response.IsHeartbeat() { ptype = impl.PackageHeartbeat } @@ -190,7 +189,7 @@ func (c *DubboCodec) decodeRequest(data []byte) (*remoting.Request, int, error) if err != nil { originErr := perrors.Cause(err) if originErr == hessian.ErrHeaderNotEnough || originErr == hessian.ErrBodyNotEnough { - //FIXME + // FIXME return nil, 0, originErr } logger.Errorf("pkg.Unmarshal(len(@data):%d) = error:%+v", buf.Len(), err) @@ -207,19 +206,19 @@ func (c *DubboCodec) decodeRequest(data []byte) (*remoting.Request, int, error) // convert params of request req := pkg.Body.(map[string]interface{}) - //invocation := request.Data.(*invocation.RPCInvocation) + // invocation := request.Data.(*invocation.RPCInvocation) var methodName string var args []interface{} attachments := make(map[string]interface{}) if req[impl.DubboVersionKey] != nil { - //dubbo version + // dubbo version request.Version = req[impl.DubboVersionKey].(string) } - //path + // path attachments[constant.PATH_KEY] = pkg.Service.Path - //version + // version attachments[constant.VERSION_KEY] = pkg.Service.Version - //method + // method methodName = pkg.Service.Method args = req[impl.ArgsKey].([]interface{}) attachments = req[impl.AttachmentsKey].(map[string]interface{}) @@ -248,7 +247,7 @@ func (c *DubboCodec) decodeResponse(data []byte) (*remoting.Response, int, error } response := &remoting.Response{ ID: pkg.Header.ID, - //Version: pkg.Header., + // Version: pkg.Header., SerialID: pkg.Header.SerialID, Status: pkg.Header.ResponseStatus, Event: (pkg.Header.Type & impl.PackageHeartbeat) != 0, @@ -264,7 +263,7 @@ func (c *DubboCodec) decodeResponse(data []byte) (*remoting.Response, int, error } else { logger.Debugf("get rpc heartbeat request{header: %#v, service: %#v, body: %#v}", pkg.Header, pkg.Service, pkg.Body) response.Status = hessian.Response_OK - //reply(session, p, hessian.PackageHeartbeat) + // reply(session, p, hessian.PackageHeartbeat) } return response, hessian.HEADER_LENGTH + pkg.Header.BodyLen, error } diff --git a/protocol/dubbo/dubbo_invoker.go b/protocol/dubbo/dubbo_invoker.go index bc85d73032..12bab314b5 100644 --- a/protocol/dubbo/dubbo_invoker.go +++ b/protocol/dubbo/dubbo_invoker.go @@ -39,10 +39,10 @@ import ( "github.com/apache/dubbo-go/remoting" ) -var ( - attachmentKey = []string{constant.INTERFACE_KEY, constant.GROUP_KEY, constant.TOKEN_KEY, constant.TIMEOUT_KEY, - constant.VERSION_KEY} -) +var attachmentKey = []string{ + constant.INTERFACE_KEY, constant.GROUP_KEY, constant.TOKEN_KEY, constant.TIMEOUT_KEY, + constant.VERSION_KEY, +} // DubboInvoker is implement of protocol.Invoker. A dubboInvoker refers to one service and ip. type DubboInvoker struct { @@ -141,7 +141,7 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati logger.Errorf("ParseBool - error: %v", err) async = false } - //response := NewResponse(inv.Reply(), nil) + // response := NewResponse(inv.Reply(), nil) rest := &protocol.RPCResult{} timeout := di.getTimeout(inv) if async { @@ -168,7 +168,7 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati // get timeout including methodConfig func (di *DubboInvoker) getTimeout(invocation *invocation_impl.RPCInvocation) time.Duration { - var timeout = di.GetUrl().GetParam(strings.Join([]string{constant.METHOD_KEYS, invocation.MethodName(), constant.TIMEOUT_KEY}, "."), "") + timeout := di.GetUrl().GetParam(strings.Join([]string{constant.METHOD_KEYS, invocation.MethodName(), constant.TIMEOUT_KEY}, "."), "") if len(timeout) != 0 { if t, err := time.ParseDuration(timeout); err == nil { // config timeout into attachment diff --git a/protocol/dubbo/dubbo_invoker_test.go b/protocol/dubbo/dubbo_invoker_test.go index fecb3b01ab..cfa81ca0b3 100644 --- a/protocol/dubbo/dubbo_invoker_test.go +++ b/protocol/dubbo/dubbo_invoker_test.go @@ -70,7 +70,7 @@ func TestDubboInvokerInvoke(t *testing.T) { r := response.(remoting.AsyncCallbackResponse) rst := *r.Reply.(*remoting.Response).Result.(*protocol.RPCResult) assert.Equal(t, User{Id: "1", Name: "username"}, *(rst.Rest.(*User))) - //assert.Equal(t, User{ID: "1", Name: "username"}, *r.Reply.(*Response).reply.(*User)) + // assert.Equal(t, User{ID: "1", Name: "username"}, *r.Reply.(*Response).reply.(*User)) lock.Unlock() }) res = invoker.Invoke(context.Background(), inv) @@ -94,7 +94,6 @@ func TestDubboInvokerInvoke(t *testing.T) { } func InitTest(t *testing.T) (protocol.Protocol, *common.URL) { - hessian.RegisterPOJO(&User{}) methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "dubbo", "", "", &UserProvider{}) @@ -139,7 +138,8 @@ func InitTest(t *testing.T) (protocol.Protocol, *common.URL) { WaitTimeout: "1s", MaxMsgLen: 10240000000, SessionName: "server", - }}) + }, + }) // Export proto := GetProtocol() @@ -168,8 +168,7 @@ type ( Name string `json:"name"` } - UserProvider struct { - //user map[string]User + UserProvider struct { // user map[string]User } ) @@ -209,7 +208,6 @@ func (u *UserProvider) GetUser3(rsp *[]interface{}) error { } func (u *UserProvider) GetUser4(ctx context.Context, req []interface{}) ([]interface{}, error) { - return []interface{}{User{Id: req[0].([]interface{})[0].(string), Name: req[0].([]interface{})[1].(string)}}, nil } diff --git a/protocol/dubbo/dubbo_protocol.go b/protocol/dubbo/dubbo_protocol.go index d6a71dc001..ce0ce47825 100644 --- a/protocol/dubbo/dubbo_protocol.go +++ b/protocol/dubbo/dubbo_protocol.go @@ -56,9 +56,7 @@ func init() { extension.SetProtocol(DUBBO, GetProtocol) } -var ( - dubboProtocol *DubboProtocol -) +var dubboProtocol *DubboProtocol // It support dubbo protocol. It implements Protocol interface for dubbo protocol. type DubboProtocol struct { @@ -152,7 +150,7 @@ func doHandleRequest(rpcInvocation *invocation.RPCInvocation) protocol.RPCResult err := fmt.Errorf("don't have this exporter, key: %s", rpcInvocation.ServiceKey()) logger.Errorf(err.Error()) result.Err = err - //reply(session, p, hessian.PackageResponse) + // reply(session, p, hessian.PackageResponse) return result } invoker := exporter.(protocol.Exporter).GetInvoker() @@ -163,12 +161,12 @@ func doHandleRequest(rpcInvocation *invocation.RPCInvocation) protocol.RPCResult invokeResult := invoker.Invoke(ctx, rpcInvocation) if err := invokeResult.Error(); err != nil { result.Err = invokeResult.Error() - //p.Header.ResponseStatus = hessian.Response_OK - //p.Body = hessian.NewResponse(nil, err, result.Attachments()) + // p.Header.ResponseStatus = hessian.Response_OK + // p.Body = hessian.NewResponse(nil, err, result.Attachments()) } else { result.Rest = invokeResult.Result() - //p.Header.ResponseStatus = hessian.Response_OK - //p.Body = hessian.NewResponse(res, nil, result.Attachments()) + // p.Header.ResponseStatus = hessian.Response_OK + // p.Body = hessian.NewResponse(res, nil, result.Attachments()) } } else { result.Err = fmt.Errorf("don't have the invoker, key: %s", rpcInvocation.ServiceKey()) diff --git a/protocol/dubbo/dubbo_protocol_test.go b/protocol/dubbo/dubbo_protocol_test.go index 9eba90e9da..f564c6da7a 100644 --- a/protocol/dubbo/dubbo_protocol_test.go +++ b/protocol/dubbo/dubbo_protocol_test.go @@ -58,7 +58,8 @@ func initDubboInvokerTest() { WaitTimeout: "1s", MaxMsgLen: 10240000000, SessionName: "server", - }}) + }, + }) getty.SetClientConf(getty.ClientConfig{ ConnectionNum: 1, HeartbeatPeriod: "3s", diff --git a/protocol/dubbo/hessian2/hessian_dubbo.go b/protocol/dubbo/hessian2/hessian_dubbo.go index 5ffebde54b..f61733fbed 100644 --- a/protocol/dubbo/hessian2/hessian_dubbo.go +++ b/protocol/dubbo/hessian2/hessian_dubbo.go @@ -107,7 +107,6 @@ func (h *HessianCodec) Write(service Service, header DubboHeader, body interface // ReadHeader uses hessian codec to read dubbo header func (h *HessianCodec) ReadHeader(header *DubboHeader) error { - var err error if h.reader.Size() < HEADER_LENGTH { @@ -169,12 +168,10 @@ func (h *HessianCodec) ReadHeader(header *DubboHeader) error { } return perrors.WithStack(err) - } // ReadBody uses hessian codec to read response body func (h *HessianCodec) ReadBody(rspObj interface{}) error { - if h.reader.Buffered() < h.bodyLen { return ErrBodyNotEnough } diff --git a/protocol/dubbo/hessian2/hessian_dubbo_test.go b/protocol/dubbo/hessian2/hessian_dubbo_test.go index eaaf500738..e603b0086b 100644 --- a/protocol/dubbo/hessian2/hessian_dubbo_test.go +++ b/protocol/dubbo/hessian2/hessian_dubbo_test.go @@ -54,7 +54,7 @@ func (c CaseA) JavaClassName() string { return "com.test.casea" } -//JavaClassName java fully qualified path +// JavaClassName java fully qualified path func (c Case) JavaClassName() string { return "com.test.case" } diff --git a/protocol/dubbo/hessian2/hessian_request.go b/protocol/dubbo/hessian2/hessian_request.go index 94aa34dee8..7c4849ffcf 100644 --- a/protocol/dubbo/hessian2/hessian_request.go +++ b/protocol/dubbo/hessian2/hessian_request.go @@ -274,7 +274,6 @@ END: // hessian decode request body func unpackRequestBody(decoder *hessian.Decoder, reqObj interface{}) error { - if decoder == nil { return perrors.Errorf("@decoder is nil") } diff --git a/protocol/dubbo/hessian2/hessian_response.go b/protocol/dubbo/hessian2/hessian_response.go index b95e1c2711..bed8dadb1f 100644 --- a/protocol/dubbo/hessian2/hessian_response.go +++ b/protocol/dubbo/hessian2/hessian_response.go @@ -18,11 +18,12 @@ package hessian2 import ( "encoding/binary" - "github.com/apache/dubbo-go/common/logger" "math" "reflect" "strconv" "strings" + + "github.com/apache/dubbo-go/common/logger" ) import ( @@ -64,9 +65,7 @@ func EnsureResponse(body interface{}) *DubboResponse { // https://github.com/apache/dubbo/blob/dubbo-2.7.1/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java#L256 // hessian encode response func packResponse(header DubboHeader, ret interface{}) ([]byte, error) { - var ( - byteArray []byte - ) + var byteArray []byte response := EnsureResponse(ret) @@ -362,7 +361,7 @@ func version2Int(ver interface{}) int { if !ok || len(version) == 0 { return 0 } - var v = 0 + v := 0 varr := strings.Split(version, ".") length := len(varr) for key, value := range varr { diff --git a/protocol/dubbo/hessian2/hessian_response_test.go b/protocol/dubbo/hessian2/hessian_response_test.go index f5c84baa90..86c2e43a9e 100644 --- a/protocol/dubbo/hessian2/hessian_response_test.go +++ b/protocol/dubbo/hessian2/hessian_response_test.go @@ -93,7 +93,7 @@ func TestReflectResponse(t *testing.T) { var s1r []string doTestReflectResponse(t, s1, &s1r) - s2 := []rr{rr{"dubbo", 666}, rr{"go", 999}} + s2 := []rr{{"dubbo", 666}, {"go", 999}} var s2r []rr doTestReflectResponse(t, s2, &s2r) @@ -221,5 +221,4 @@ func TestVersion2Int(t *testing.T) { v = version2Int("2.1.3.4.5") assert.Equal(t, 201030405, v) - } diff --git a/protocol/dubbo/impl/codec.go b/protocol/dubbo/impl/codec.go index 6c9816f0ff..d4f3804268 100644 --- a/protocol/dubbo/impl/codec.go +++ b/protocol/dubbo/impl/codec.go @@ -238,9 +238,7 @@ func packRequest(p DubboPackage, serializer Serializer) ([]byte, error) { } func packResponse(p DubboPackage, serializer Serializer) ([]byte, error) { - var ( - byteArray []byte - ) + var byteArray []byte header := p.Header hb := p.IsHeartBeat() diff --git a/protocol/dubbo/impl/hessian.go b/protocol/dubbo/impl/hessian.go index 4aaf67b6f3..2f750c53a6 100644 --- a/protocol/dubbo/impl/hessian.go +++ b/protocol/dubbo/impl/hessian.go @@ -37,8 +37,7 @@ import ( "github.com/apache/dubbo-go/common/logger" ) -type HessianSerializer struct { -} +type HessianSerializer struct{} func (h HessianSerializer) Marshal(p DubboPackage) ([]byte, error) { encoder := hessian.NewEncoder() @@ -178,7 +177,7 @@ func isSupportResponseAttachment(version string) bool { } func version2Int(version string) int { - var v = 0 + v := 0 varr := strings.Split(version, ".") length := len(varr) for key, value := range varr { diff --git a/protocol/dubbo/opentracing.go b/protocol/dubbo/opentracing.go index f45e6fdc71..bc270506f3 100644 --- a/protocol/dubbo/opentracing.go +++ b/protocol/dubbo/opentracing.go @@ -20,6 +20,7 @@ package dubbo import ( "github.com/opentracing/opentracing-go" ) + import ( invocation_impl "github.com/apache/dubbo-go/protocol/invocation" ) @@ -36,7 +37,7 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca } func filterContext(attachments map[string]interface{}) map[string]string { - var traceAttchment = make(map[string]string) + traceAttchment := make(map[string]string) for k, v := range attachments { if r, ok := v.(string); ok { traceAttchment[k] = r diff --git a/protocol/grpc/client.go b/protocol/grpc/client.go index b8a9143764..567996b6f5 100644 --- a/protocol/grpc/client.go +++ b/protocol/grpc/client.go @@ -36,9 +36,7 @@ import ( "github.com/apache/dubbo-go/config" ) -var ( - clientConf *ClientConfig -) +var clientConf *ClientConfig func init() { // load clientconfig from consumer_config @@ -80,7 +78,6 @@ func init() { panic(err) } } - } // Client is gRPC client include client connection and invoker @@ -96,7 +93,7 @@ func NewClient(url *common.URL) (*Client, error) { dialOpts := make([]grpc.DialOption, 0, 4) maxMessageSize, _ := strconv.Atoi(url.GetParam(constant.MESSAGE_SIZE_KEY, "4")) - //consumer config client connectTimeout + // consumer config client connectTimeout connectTimeout := config.GetConsumerConfig().ConnectTimeout dialOpts = append(dialOpts, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(connectTimeout), grpc.WithUnaryInterceptor( @@ -107,7 +104,6 @@ func NewClient(url *common.URL) (*Client, error) { grpc.MaxCallSendMsgSize(1024*1024*maxMessageSize))) conn, err := grpc.Dial(url.Location, dialOpts...) - if err != nil { logger.Errorf("grpc dail error: %v", err) return nil, err diff --git a/protocol/grpc/config.go b/protocol/grpc/config.go index e8a9baac89..d0a192042c 100644 --- a/protocol/grpc/config.go +++ b/protocol/grpc/config.go @@ -23,8 +23,7 @@ import ( type ( // ServerConfig currently is empty struct,for future expansion - ServerConfig struct { - } + ServerConfig struct{} // ClientConfig wrap client call parameters ClientConfig struct { diff --git a/protocol/grpc/grpc_invoker.go b/protocol/grpc/grpc_invoker.go index 7b33c6704d..79eb3ca43f 100644 --- a/protocol/grpc/grpc_invoker.go +++ b/protocol/grpc/grpc_invoker.go @@ -35,9 +35,7 @@ import ( "github.com/apache/dubbo-go/protocol" ) -var ( - errNoReply = errors.New("request need @response") -) +var errNoReply = errors.New("request need @response") // nolint type GrpcInvoker struct { @@ -72,9 +70,7 @@ func (gi *GrpcInvoker) getClient() *Client { // 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 - ) + var result protocol.RPCResult if !gi.BaseInvoker.IsAvailable() { // Generally, the case will not happen, because the invoker has been removed diff --git a/protocol/grpc/internal/client.go b/protocol/grpc/internal/client.go index 3ce0f570b7..83b4586c68 100644 --- a/protocol/grpc/internal/client.go +++ b/protocol/grpc/internal/client.go @@ -34,7 +34,7 @@ func init() { } // GrpcGreeterImpl -//used for dubbo-grpc biz client +// used for dubbo-grpc biz client type GrpcGreeterImpl struct { SayHello func(ctx context.Context, in *HelloRequest, out *HelloReply) error } diff --git a/protocol/grpc/internal/helloworld.pb.go b/protocol/grpc/internal/helloworld.pb.go index 82537f553b..2ea04fd5fa 100644 --- a/protocol/grpc/internal/helloworld.pb.go +++ b/protocol/grpc/internal/helloworld.pb.go @@ -32,9 +32,11 @@ import ( ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -60,15 +62,19 @@ func (*HelloRequest) Descriptor() ([]byte, []int) { func (m *HelloRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HelloRequest.Unmarshal(m, b) } + func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic) } + func (m *HelloRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_HelloRequest.Merge(m, src) } + func (m *HelloRequest) XXX_Size() int { return xxx_messageInfo_HelloRequest.Size(m) } + func (m *HelloRequest) XXX_DiscardUnknown() { xxx_messageInfo_HelloRequest.DiscardUnknown(m) } @@ -100,15 +106,19 @@ func (*HelloReply) Descriptor() ([]byte, []int) { func (m *HelloReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HelloReply.Unmarshal(m, b) } + func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic) } + func (m *HelloReply) XXX_Merge(src proto.Message) { xxx_messageInfo_HelloReply.Merge(m, src) } + func (m *HelloReply) XXX_Size() int { return xxx_messageInfo_HelloReply.Size(m) } + func (m *HelloReply) XXX_DiscardUnknown() { xxx_messageInfo_HelloReply.DiscardUnknown(m) } @@ -145,8 +155,10 @@ var fileDescriptor_17b8c58d586b62f2 = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var ( + _ context.Context + _ grpc.ClientConn +) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -184,8 +196,7 @@ type GreeterServer interface { } // UnimplementedGreeterServer can be embedded to have forward compatible implementations. -type UnimplementedGreeterServer struct { -} +type UnimplementedGreeterServer struct{} func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) { return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") diff --git a/protocol/grpc/internal/server.go b/protocol/grpc/internal/server.go index f7b99fa0ba..6e17a4f80d 100644 --- a/protocol/grpc/internal/server.go +++ b/protocol/grpc/internal/server.go @@ -27,9 +27,7 @@ import ( "google.golang.org/grpc" ) -var ( - s *grpc.Server -) +var s *grpc.Server // server is used to implement helloworld.GreeterServer. type server struct { diff --git a/protocol/grpc/protoc-gen-dubbo/examples/helloworld.pb.go b/protocol/grpc/protoc-gen-dubbo/examples/helloworld.pb.go index 702391b299..fe86b2bf34 100644 --- a/protocol/grpc/protoc-gen-dubbo/examples/helloworld.pb.go +++ b/protocol/grpc/protoc-gen-dubbo/examples/helloworld.pb.go @@ -38,9 +38,11 @@ import ( ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -66,15 +68,19 @@ func (*HelloRequest) Descriptor() ([]byte, []int) { func (m *HelloRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HelloRequest.Unmarshal(m, b) } + func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic) } + func (m *HelloRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_HelloRequest.Merge(m, src) } + func (m *HelloRequest) XXX_Size() int { return xxx_messageInfo_HelloRequest.Size(m) } + func (m *HelloRequest) XXX_DiscardUnknown() { xxx_messageInfo_HelloRequest.DiscardUnknown(m) } @@ -106,15 +112,19 @@ func (*HelloReply) Descriptor() ([]byte, []int) { func (m *HelloReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HelloReply.Unmarshal(m, b) } + func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic) } + func (m *HelloReply) XXX_Merge(src proto.Message) { xxx_messageInfo_HelloReply.Merge(m, src) } + func (m *HelloReply) XXX_Size() int { return xxx_messageInfo_HelloReply.Size(m) } + func (m *HelloReply) XXX_DiscardUnknown() { xxx_messageInfo_HelloReply.DiscardUnknown(m) } @@ -152,8 +162,10 @@ var fileDescriptor_17b8c58d586b62f2 = []byte{ } // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var ( + _ context.Context + _ grpc.ClientConn +) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -191,8 +203,7 @@ type GreeterServer interface { } // UnimplementedGreeterServer can be embedded to have forward compatible implementations. -type UnimplementedGreeterServer struct { -} +type UnimplementedGreeterServer struct{} func (*UnimplementedGreeterServer) SayHello(ctx context.Context, req *HelloRequest) (*HelloReply, error) { return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") diff --git a/protocol/jsonrpc/http.go b/protocol/jsonrpc/http.go index 11051df8ac..0ad76e078e 100644 --- a/protocol/jsonrpc/http.go +++ b/protocol/jsonrpc/http.go @@ -56,7 +56,7 @@ type Request struct { service string method string args interface{} - //contentType string + // contentType string } // //////////////////////////////////////////// @@ -102,7 +102,6 @@ func NewHTTPClient(opt *HTTPOptions) *HTTPClient { // NewRequest creates a new HTTP request with @service ,@method and @arguments. func (c *HTTPClient) NewRequest(service *common.URL, method string, args interface{}) *Request { - return &Request{ ID: atomic.AddInt64(&c.ID, 1), group: service.GetParam(constant.GROUP_KEY, ""), diff --git a/protocol/jsonrpc/http_test.go b/protocol/jsonrpc/http_test.go index 5ef40649b1..caf0d222d2 100644 --- a/protocol/jsonrpc/http_test.go +++ b/protocol/jsonrpc/http_test.go @@ -43,8 +43,7 @@ type ( Name string `json:"name"` } - UserProvider struct { - //user map[string]User + UserProvider struct { // user map[string]User } ) @@ -57,7 +56,6 @@ const ( ) func TestHTTPClientCall(t *testing.T) { - methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "jsonrpc", "", "", &UserProvider{}) assert.NoError(t, err) assert.Equal(t, "GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4", methods) @@ -165,7 +163,6 @@ func TestHTTPClientCall(t *testing.T) { // destroy proto.Destroy() - } func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User) error { diff --git a/protocol/jsonrpc/json.go b/protocol/jsonrpc/json.go index 81ca512271..2383bf5d8b 100644 --- a/protocol/jsonrpc/json.go +++ b/protocol/jsonrpc/json.go @@ -231,7 +231,7 @@ func (r *serverRequest) UnmarshalJSON(raw []byte) error { return perrors.New("bad request") } - var o = make(map[string]*json.RawMessage) + o := make(map[string]*json.RawMessage) if err := json.Unmarshal(raw, &o); err != nil { return perrors.New("bad request") } diff --git a/protocol/jsonrpc/json_test.go b/protocol/jsonrpc/json_test.go index a3814e9ad5..6d3e11bfab 100644 --- a/protocol/jsonrpc/json_test.go +++ b/protocol/jsonrpc/json_test.go @@ -54,7 +54,7 @@ func TestJsonClientCodecRead(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "test", rsp.Test) - //error + // error codec.pending[1] = "GetUser" err = codec.Read([]byte("{\"jsonrpc\":\"2.0\",\"id\":1,\"error\":{\"code\":-32000,\"message\":\"error\"}}\n"), rsp) assert.EqualError(t, err, "{\"code\":-32000,\"message\":\"error\"}") diff --git a/protocol/jsonrpc/jsonrpc_invoker_test.go b/protocol/jsonrpc/jsonrpc_invoker_test.go index 12a57052eb..c6049291fc 100644 --- a/protocol/jsonrpc/jsonrpc_invoker_test.go +++ b/protocol/jsonrpc/jsonrpc_invoker_test.go @@ -35,7 +35,6 @@ import ( ) func TestJsonrpcInvokerInvoke(t *testing.T) { - methods, err := common.ServiceMap.Register("com.ikurento.user.UserProvider", "jsonrpc", "", "", &UserProvider{}) assert.NoError(t, err) assert.Equal(t, "GetUser,GetUser0,GetUser1,GetUser2,GetUser3,GetUser4", methods) diff --git a/protocol/jsonrpc/jsonrpc_protocol.go b/protocol/jsonrpc/jsonrpc_protocol.go index 643bcde8cb..313d32fc7c 100644 --- a/protocol/jsonrpc/jsonrpc_protocol.go +++ b/protocol/jsonrpc/jsonrpc_protocol.go @@ -34,7 +34,7 @@ import ( const ( // JSONRPC - //module name + // module name JSONRPC = "jsonrpc" ) @@ -76,8 +76,8 @@ func (jp *JsonrpcProtocol) Export(invoker protocol.Invoker) protocol.Exporter { // Refer a remote JSON PRC service from registry func (jp *JsonrpcProtocol) Refer(url *common.URL) protocol.Invoker { - //default requestTimeout - var requestTimeout = config.GetConsumerConfig().RequestTimeout + // default requestTimeout + requestTimeout := config.GetConsumerConfig().RequestTimeout requestTimeoutStr := url.GetParam(constant.TIMEOUT_KEY, config.GetConsumerConfig().Request_Timeout) if t, err := time.ParseDuration(requestTimeoutStr); err == nil { diff --git a/protocol/jsonrpc/server.go b/protocol/jsonrpc/server.go index 76901bff6e..c16f656706 100644 --- a/protocol/jsonrpc/server.go +++ b/protocol/jsonrpc/server.go @@ -43,12 +43,10 @@ import ( "github.com/apache/dubbo-go/protocol/invocation" ) -var ( - // A value sent as a placeholder for the server's response value when the server - // receives an invalid request. It is never decoded by the client since the Response - // contains an error when it is used. - invalidRequest = struct{}{} -) +// A value sent as a placeholder for the server's response value when the server +// receives an invalid request. It is never decoded by the client since the Response +// contains an error when it is used. +var invalidRequest = struct{}{} const ( // DefaultMaxSleepTime max sleep interval in accept @@ -349,7 +347,8 @@ func serveRequest(ctx context.Context, header map[string]string, body []byte, co if invoker != nil { result := invoker.Invoke(ctx, invocation.NewRPCInvocation(methodName, args, map[string]interface{}{ constant.PATH_KEY: path, - constant.VERSION_KEY: codec.req.Version})) + constant.VERSION_KEY: codec.req.Version, + })) if err := result.Error(); err != nil { rspStream, codecErr := codec.Write(err.Error(), invalidRequest) if codecErr != nil { diff --git a/protocol/protocol.go b/protocol/protocol.go index d03e70f1ea..19ec8ed2cd 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -137,7 +137,6 @@ func NewBaseExporter(key string, invoker Invoker, exporterMap *sync.Map) *BaseEx // GetInvoker gets invoker func (de *BaseExporter) GetInvoker() Invoker { return de.invoker - } // Unexport exported service. diff --git a/protocol/protocolwrapper/protocol_filter_wrapper_test.go b/protocol/protocolwrapper/protocol_filter_wrapper_test.go index b37d066f03..d096784abb 100644 --- a/protocol/protocolwrapper/protocol_filter_wrapper_test.go +++ b/protocol/protocolwrapper/protocol_filter_wrapper_test.go @@ -60,7 +60,7 @@ func TestProtocolFilterWrapperRefer(t *testing.T) { assert.True(t, ok) } -//the same as echo filter, for test +// the same as echo filter, for test func init() { extension.SetFilter("echo", GetFilter) } diff --git a/protocol/rest/config/reader/rest_config_reader.go b/protocol/rest/config/reader/rest_config_reader.go index 2338790ea9..e545d8567c 100644 --- a/protocol/rest/config/reader/rest_config_reader.go +++ b/protocol/rest/config/reader/rest_config_reader.go @@ -43,8 +43,7 @@ func init() { extension.SetDefaultConfigReader(REST, REST) } -type RestConfigReader struct { -} +type RestConfigReader struct{} func NewRestConfigReader() interfaces.ConfigReader { return &RestConfigReader{} diff --git a/protocol/rest/rest_invoker_test.go b/protocol/rest/rest_invoker_test.go index b6bc980653..5a5bd2cc2a 100644 --- a/protocol/rest/rest_invoker_test.go +++ b/protocol/rest/rest_invoker_test.go @@ -199,7 +199,7 @@ func TestRestInvokerInvoke(t *testing.T) { assert.Equal(t, "username", res.Result().(*User).Name) // test 3 inv = invocation.NewRPCInvocationWithOptions(invocation.WithMethodName("GetUserFour"), - invocation.WithArguments([]interface{}{[]User{User{1, nil, int32(23), "username"}}}), invocation.WithReply(user)) + invocation.WithArguments([]interface{}{[]User{{1, nil, int32(23), "username"}}}), invocation.WithReply(user)) res = invoker.Invoke(context.Background(), inv) assert.NoError(t, res.Error()) assert.NotNil(t, res.Result()) diff --git a/protocol/rest/rest_protocol.go b/protocol/rest/rest_protocol.go index d19bd002fc..a87eb09f06 100644 --- a/protocol/rest/rest_protocol.go +++ b/protocol/rest/rest_protocol.go @@ -37,9 +37,7 @@ import ( _ "github.com/apache/dubbo-go/protocol/rest/server/server_impl" ) -var ( - restProtocol *RestProtocol -) +var restProtocol *RestProtocol const REST = "rest" @@ -88,7 +86,7 @@ func (rp *RestProtocol) Export(invoker protocol.Invoker) protocol.Exporter { // Refer create rest service reference func (rp *RestProtocol) Refer(url *common.URL) protocol.Invoker { // create rest_invoker - var requestTimeout = config.GetConsumerConfig().RequestTimeout + requestTimeout := config.GetConsumerConfig().RequestTimeout requestTimeoutStr := url.GetParam(constant.TIMEOUT_KEY, config.GetConsumerConfig().Request_Timeout) connectTimeout := config.GetConsumerConfig().ConnectTimeout if t, err := time.ParseDuration(requestTimeoutStr); err == nil { diff --git a/protocol/rest/rest_protocol_test.go b/protocol/rest/rest_protocol_test.go index 580fc61fd6..4809564846 100644 --- a/protocol/rest/rest_protocol_test.go +++ b/protocol/rest/rest_protocol_test.go @@ -122,8 +122,7 @@ func TestRestProtocolExport(t *testing.T) { assert.False(t, ok) } -type UserProvider struct { -} +type UserProvider struct{} func (p *UserProvider) Reference() string { return "com.ikurento.user.UserProvider" diff --git a/protocol/rest/server/server_impl/go_restful_server.go b/protocol/rest/server/server_impl/go_restful_server.go index 4481f44912..b42bb6e0e0 100644 --- a/protocol/rest/server/server_impl/go_restful_server.go +++ b/protocol/rest/server/server_impl/go_restful_server.go @@ -87,7 +87,6 @@ func (grs *GoRestfulServer) Start(url *common.URL) { // Publish a http api in go-restful server // The routeFunc should be invoked when the server receive a request func (grs *GoRestfulServer) Deploy(restMethodConfig *config.RestMethodConfig, routeFunc func(request server.RestServerRequest, response server.RestServerResponse)) { - rf := func(req *restful.Request, resp *restful.Response) { routeFunc(NewGoRestfulRequestAdapter(req), resp) } diff --git a/protocol/rpc_status.go b/protocol/rpc_status.go index 8fc5ddd76e..3994f8dd7b 100644 --- a/protocol/rpc_status.go +++ b/protocol/rpc_status.go @@ -263,7 +263,7 @@ func TryRefreshBlackList() { wg.Add(1) go func(ivks []Invoker, i int) { defer wg.Done() - for j, _ := range ivks { + for j := range ivks { if j%3-i == 0 && ivks[j].(Invoker).IsAvailable() { RemoveInvokerUnhealthyStatus(ivks[i]) } diff --git a/protocol/rpc_status_test.go b/protocol/rpc_status_test.go index 6fd449ce77..568d5c53e5 100644 --- a/protocol/rpc_status_test.go +++ b/protocol/rpc_status_test.go @@ -45,7 +45,6 @@ func TestBeginCount(t *testing.T) { assert.Equal(t, int32(1), methodStatus.active) assert.Equal(t, int32(1), urlStatus.active) assert.Equal(t, int32(0), methodStatus1.active) - } func TestEndCount(t *testing.T) { @@ -139,7 +138,6 @@ func TestAll(t *testing.T) { methodStatus1 := GetMethodStatus(url, "test1") assert.Equal(t, int32(2), methodStatus.successiveRequestFailureCount) assert.Equal(t, int32(3), methodStatus1.successiveRequestFailureCount) - } func request(url *common.URL, method string, elapsed int64, active, succeeded bool) { diff --git a/registry/base_configuration_listener.go b/registry/base_configuration_listener.go index 31e859eec2..67dee9d0fa 100644 --- a/registry/base_configuration_listener.go +++ b/registry/base_configuration_listener.go @@ -48,7 +48,7 @@ func (bcl *BaseConfigurationListener) InitWith(key string, listener config_cente bcl.dynamicConfiguration = config.GetEnvInstance().GetDynamicConfiguration() if bcl.dynamicConfiguration == nil { - //set configurators to empty + // set configurators to empty bcl.configurators = []config_center.Configurator{} return } @@ -56,7 +56,7 @@ func (bcl *BaseConfigurationListener) InitWith(key string, listener config_cente bcl.dynamicConfiguration.AddListener(key, listener) if rawConfig, err := bcl.dynamicConfiguration.GetInternalProperty(key, config_center.WithGroup(constant.DUBBO)); err != nil { - //set configurators to empty + // set configurators to empty bcl.configurators = []config_center.Configurator{} return } else if len(rawConfig) > 0 { diff --git a/registry/base_registry.go b/registry/base_registry.go index df8c8a3250..a16a998511 100644 --- a/registry/base_registry.go +++ b/registry/base_registry.go @@ -92,13 +92,13 @@ type FacadeBasedRegistry interface { // BaseRegistry is a common logic abstract for registry. It implement Registry interface. type BaseRegistry struct { - //context context.Context + // context context.Context facadeBasedRegistry FacadeBasedRegistry *common.URL birth int64 // time of file birth, seconds since Epoch; 0 if unknown wg sync.WaitGroup // wg+done for zk restart done chan struct{} - cltLock sync.RWMutex //ctl lock is a lock for services map + cltLock sync.RWMutex // ctl lock is a lock for services map services map[string]*common.URL // service name + protocol -> service config, for store the service registered } @@ -119,14 +119,14 @@ func (r *BaseRegistry) GetUrl() *common.URL { // Destroy for graceful down func (r *BaseRegistry) Destroy() { - //first step close registry's all listeners + // first step close registry's all listeners r.facadeBasedRegistry.CloseListener() // then close r.done to notify other program who listen to it close(r.done) // wait waitgroup done (wait listeners outside close over) r.wg.Wait() - //close registry client + // close registry client r.closeRegisters() } @@ -209,7 +209,6 @@ func (r *BaseRegistry) service(c *common.URL) string { // RestartCallBack for reregister when reconnect func (r *BaseRegistry) RestartCallBack() bool { - // copy r.services services := make([]*common.URL, 0, len(r.services)) for _, confIf := range r.services { @@ -251,12 +250,12 @@ func (r *BaseRegistry) processURL(c *common.URL, f func(string, string) error, c } var ( err error - //revision string + // revision string params url.Values rawURL string encodedURL string dubboPath string - //conf config.URL + // conf config.URL ) params = url.Values{} @@ -267,7 +266,7 @@ func (r *BaseRegistry) processURL(c *common.URL, f func(string, string) error, c params.Add("pid", processID) params.Add("ip", localIP) - //params.Add("timeout", fmt.Sprintf("%d", int64(r.Timeout)/1e6)) + // params.Add("timeout", fmt.Sprintf("%d", int64(r.Timeout)/1e6)) role, _ := strconv.Atoi(r.URL.GetParam(constant.ROLE_KEY, "")) switch role { @@ -335,7 +334,7 @@ func (r *BaseRegistry) providerRegistry(c *common.URL, params url.Values, f crea } host += ":" + c.Port - //delete empty param key + // delete empty param key for key, val := range params { if len(val) > 0 && val[0] == "" { params.Del(key) @@ -426,7 +425,6 @@ func (r *BaseRegistry) Subscribe(url *common.URL, notifyListener NotifyListener) logger.Infof("update begin, service event: %v", serviceEvent.String()) notifyListener.Notify(serviceEvent) } - } sleepWait(n) } @@ -458,7 +456,6 @@ func (r *BaseRegistry) UnSubscribe(url *common.URL, notifyListener NotifyListene logger.Infof("update begin, service event: %v", serviceEvent.String()) notifyListener.Notify(serviceEvent) } - } return nil } diff --git a/registry/consul/service_discovery.go b/registry/consul/service_discovery.go index fba142e04e..da5d8d075b 100644 --- a/registry/consul/service_discovery.go +++ b/registry/consul/service_discovery.go @@ -50,9 +50,7 @@ const ( watch_passingonly_true = true ) -var ( - errConsulClientClosed = perrors.New("consul client is closed") -) +var errConsulClientClosed = perrors.New("consul client is closed") // init will put the service discovery into extension func init() { @@ -241,7 +239,7 @@ func (csd *consulServiceDiscovery) GetServices() *gxset.HashSet { consulClient *consul.Client services map[string][]string ) - var res = gxset.NewSet() + res := gxset.NewSet() if consulClient = csd.getConsulClient(); consulClient == nil { logger.Warnf("consul client is closed!") return res @@ -256,7 +254,6 @@ func (csd *consulServiceDiscovery) GetServices() *gxset.HashSet { res.Add(service) } return res - } // encodeConsulMetadata because consul validate key strictly. @@ -370,7 +367,6 @@ func (csd *consulServiceDiscovery) GetRequestInstances(serviceNames []string, of } func (csd *consulServiceDiscovery) AddListener(listener *registry.ServiceInstancesChangedListener) error { - params := make(map[string]interface{}, 8) params[watch_type] = watch_type_service params[watch_service] = listener.ServiceName diff --git a/registry/consul/service_discovery_test.go b/registry/consul/service_discovery_test.go index 3f97d841d5..68e804294d 100644 --- a/registry/consul/service_discovery_test.go +++ b/registry/consul/service_discovery_test.go @@ -90,7 +90,7 @@ func TestConsulServiceDiscovery_CRUD(t *testing.T) { }() prepareData() - var eventDispatcher = MockEventDispatcher{Notify: make(chan struct{}, 1)} + eventDispatcher := MockEventDispatcher{Notify: make(chan struct{}, 1)} extension.SetEventDispatcher("mock", func() observer.EventDispatcher { return &eventDispatcher }) @@ -110,8 +110,8 @@ func TestConsulServiceDiscovery_CRUD(t *testing.T) { err = serviceDiscovery.Register(instance) assert.Nil(t, err) - //sometimes nacos may be failed to push update of instance, - //so it need 10s to pull, we sleep 10 second to make sure instance has been update + // sometimes nacos may be failed to push update of instance, + // so it need 10s to pull, we sleep 10 second to make sure instance has been update time.Sleep(3 * time.Second) page := serviceDiscovery.GetHealthyInstancesByPage(instance.GetServiceName(), 0, 10, true) assert.NotNil(t, page) @@ -146,8 +146,8 @@ func TestConsulServiceDiscovery_CRUD(t *testing.T) { assert.Equal(t, "bbb", v) // test dispatcher event - //err = serviceDiscovery.DispatchEventByServiceName(instanceResult.GetServiceName()) - //assert.Nil(t, err) + // err = serviceDiscovery.DispatchEventByServiceName(instanceResult.GetServiceName()) + // assert.Nil(t, err) // test AddListener err = serviceDiscovery.AddListener(®istry.ServiceInstancesChangedListener{ServiceName: instance.GetServiceName()}) diff --git a/registry/consul/utils_test.go b/registry/consul/utils_test.go index b7e2929cec..3319bebeb1 100644 --- a/registry/consul/utils_test.go +++ b/registry/consul/utils_test.go @@ -19,13 +19,14 @@ package consul import ( "fmt" - "github.com/apache/dubbo-go/common/logger" - "github.com/stretchr/testify/assert" "net" "net/url" "strconv" "sync" "testing" + + "github.com/apache/dubbo-go/common/logger" + "github.com/stretchr/testify/assert" ) import ( diff --git a/registry/directory/directory.go b/registry/directory/directory.go index b6f932223c..3e6fbc7c8e 100644 --- a/registry/directory/directory.go +++ b/registry/directory/directory.go @@ -63,8 +63,8 @@ type RegistryDirectory struct { configurators []config_center.Configurator consumerConfigurationListener *consumerConfigurationListener referenceConfigurationListener *referenceConfigurationListener - //serviceKey string - //forbidden atomic.Bool + // serviceKey string + // forbidden atomic.Bool registerLock sync.Mutex // this lock if for register } diff --git a/registry/directory/directory_test.go b/registry/directory/directory_test.go index b5d81eb0da..b6ee10d35f 100644 --- a/registry/directory/directory_test.go +++ b/registry/directory/directory_test.go @@ -88,18 +88,18 @@ func TestSubscribe_Group(t *testing.T) { dir, _ := NewRegistryDirectory(regurl, mockRegistry) go dir.(*RegistryDirectory).subscribe(common.NewURLWithOptions(common.WithPath("testservice"))) - //for group1 + // for group1 urlmap := url.Values{} urlmap.Set(constant.GROUP_KEY, "group1") - urlmap.Set(constant.CLUSTER_KEY, "failover") //to test merge url + urlmap.Set(constant.CLUSTER_KEY, "failover") // to test merge url for i := 0; i < 3; i++ { mockRegistry.(*registry.MockRegistry).MockEvent(®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: common.NewURLWithOptions(common.WithPath("TEST"+strconv.FormatInt(int64(i), 10)), common.WithProtocol("dubbo"), common.WithParams(urlmap))}) } - //for group2 + // for group2 urlmap2 := url.Values{} urlmap2.Set(constant.GROUP_KEY, "group2") - urlmap2.Set(constant.CLUSTER_KEY, "failover") //to test merge url + urlmap2.Set(constant.CLUSTER_KEY, "failover") // to test merge url for i := 0; i < 3; i++ { mockRegistry.(*registry.MockRegistry).MockEvent(®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: common.NewURLWithOptions(common.WithPath("TEST"+strconv.FormatInt(int64(i), 10)), common.WithProtocol("dubbo"), common.WithParams(urlmap2))}) @@ -127,7 +127,6 @@ func Test_List(t *testing.T) { time.Sleep(6e9) assert.Len(t, registryDirectory.List(&invocation.RPCInvocation{}), 3) assert.Equal(t, true, registryDirectory.IsAvailable()) - } func Test_MergeProviderUrl(t *testing.T) { @@ -142,7 +141,6 @@ func Test_MergeProviderUrl(t *testing.T) { if len(registryDirectory.cacheInvokers) > 0 { assert.Equal(t, "mock", registryDirectory.cacheInvokers[0].GetUrl().GetParam(constant.CLUSTER_KEY, "")) } - } func Test_MergeOverrideUrl(t *testing.T) { @@ -207,11 +205,13 @@ func Test_RefreshUrl(t *testing.T) { mockRegistry.MockEvent(®istry.ServiceEvent{Action: remoting.EventTypeAdd, Service: providerUrl}) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 4) - mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}}) + mockRegistry.MockEvents([]*registry.ServiceEvent{{Action: remoting.EventTypeUpdate, Service: providerUrl}}) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 1) - mockRegistry.MockEvents([]*registry.ServiceEvent{®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl}, - ®istry.ServiceEvent{Action: remoting.EventTypeUpdate, Service: providerUrl2}}) + mockRegistry.MockEvents([]*registry.ServiceEvent{ + {Action: remoting.EventTypeUpdate, Service: providerUrl}, + {Action: remoting.EventTypeUpdate, Service: providerUrl2}, + }) time.Sleep(1e9) assert.Len(t, registryDirectory.cacheInvokers, 2) // clear all address diff --git a/registry/etcdv3/listener.go b/registry/etcdv3/listener.go index f900495f97..6d72899ac2 100644 --- a/registry/etcdv3/listener.go +++ b/registry/etcdv3/listener.go @@ -51,7 +51,6 @@ func (l *dataListener) AddInterestedURL(url *common.URL) { // DataChange processes the data change event from registry center of etcd func (l *dataListener) DataChange(eventType remoting.Event) bool { - index := strings.Index(eventType.Path, "/providers/") if index == -1 { logger.Warnf("Listen with no url, event.path={%v}", eventType.Path) diff --git a/registry/etcdv3/listener_test.go b/registry/etcdv3/listener_test.go index ff7f63f614..0028938b0a 100644 --- a/registry/etcdv3/listener_test.go +++ b/registry/etcdv3/listener_test.go @@ -44,7 +44,6 @@ const defaultEtcdV3WorkDir = "/tmp/default-dubbo-go-registry.etcd" // start etcd server func (suite *RegistryTestSuite) SetupSuite() { - t := suite.T() cfg := embed.NewConfig() @@ -75,7 +74,6 @@ func (suite *RegistryTestSuite) TearDownSuite() { } func (suite *RegistryTestSuite) TestDataChange() { - t := suite.T() listener := NewRegistryDataListener(&MockDataListener{}) diff --git a/registry/etcdv3/registry.go b/registry/etcdv3/registry.go index 7ccf32661c..46ba6b678a 100644 --- a/registry/etcdv3/registry.go +++ b/registry/etcdv3/registry.go @@ -73,7 +73,6 @@ func (r *etcdV3Registry) ClientLock() *sync.Mutex { } func newETCDV3Registry(url *common.URL) (registry.Registry, error) { - timeout, err := time.ParseDuration(url.GetParam(constant.REGISTRY_TIMEOUT_KEY, constant.DEFAULT_REG_TIMEOUT)) if err != nil { logger.Errorf("timeout config %v is invalid ,err is %v", @@ -95,7 +94,7 @@ func newETCDV3Registry(url *common.URL) (registry.Registry, error) { ); err != nil { return nil, err } - r.WaitGroup().Add(1) //etcdv3 client start successful, then wg +1 + r.WaitGroup().Add(1) // etcdv3 client start successful, then wg +1 go etcdv3.HandleClientRestart(r) @@ -165,7 +164,7 @@ func (r *etcdV3Registry) DoSubscribe(svc *common.URL) (registry.Listener, error) r.listenerLock.Unlock() } - //register the svc to dataListener + // register the svc to dataListener r.dataListener.AddInterestedURL(svc) go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, svc.Service()), r.dataListener) diff --git a/registry/etcdv3/registry_test.go b/registry/etcdv3/registry_test.go index d94eff656d..dbbb7afb35 100644 --- a/registry/etcdv3/registry_test.go +++ b/registry/etcdv3/registry_test.go @@ -33,7 +33,6 @@ import ( ) func initRegistry(t *testing.T) *etcdV3Registry { - regurl, err := common.NewURL("registry://127.0.0.1:2379", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) if err != nil { t.Fatal(err) @@ -51,7 +50,6 @@ func initRegistry(t *testing.T) *etcdV3Registry { } func (suite *RegistryTestSuite) TestRegister() { - t := suite.T() url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) @@ -68,19 +66,18 @@ func (suite *RegistryTestSuite) TestRegister() { } func (suite *RegistryTestSuite) TestSubscribe() { - t := suite.T() regurl, _ := common.NewURL("registry://127.0.0.1:1111", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) reg := initRegistry(t) - //provider register + // provider register err := reg.Register(url) if err != nil { t.Fatal(err) } - //consumer register + // consumer register regurl.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) reg2 := initRegistry(t) @@ -99,7 +96,6 @@ func (suite *RegistryTestSuite) TestSubscribe() { } func (suite *RegistryTestSuite) TestConsumerDestroy() { - t := suite.T() url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) @@ -109,23 +105,21 @@ func (suite *RegistryTestSuite) TestConsumerDestroy() { t.Fatal(err) } - //listener.Close() + // listener.Close() time.Sleep(1e9) reg.Destroy() assert.Equal(t, false, reg.IsAvailable()) - } func (suite *RegistryTestSuite) TestProviderDestroy() { - t := suite.T() reg := initRegistry(t) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) err := reg.Register(url) assert.NoError(t, err) - //listener.Close() + // listener.Close() time.Sleep(1e9) reg.Destroy() assert.Equal(t, false, reg.IsAvailable()) diff --git a/registry/etcdv3/service_discovery.go b/registry/etcdv3/service_discovery.go index ca6016e49b..c9c3d4366c 100644 --- a/registry/etcdv3/service_discovery.go +++ b/registry/etcdv3/service_discovery.go @@ -45,9 +45,7 @@ const ( ROOT = "/services" ) -var ( - initLock sync.Mutex -) +var initLock sync.Mutex func init() { extension.SetServiceDiscovery(constant.ETCDV3_KEY, newEtcdV3ServiceDiscovery) @@ -82,7 +80,6 @@ func (e *etcdV3ServiceDiscovery) Destroy() error { // Register will register an instance of ServiceInstance to registry func (e *etcdV3ServiceDiscovery) Register(instance registry.ServiceInstance) error { - e.serviceInstance = &instance path := toPath(instance) @@ -147,7 +144,6 @@ func (e *etcdV3ServiceDiscovery) GetServices() *gxset.HashSet { // GetInstances will return all service instances with serviceName func (e *etcdV3ServiceDiscovery) GetInstances(serviceName string) []registry.ServiceInstance { - if nil != e.client { // get keys and values _, vList, err := e.client.GetChildrenKVList(toParentPath(serviceName)) @@ -171,7 +167,6 @@ func (e *etcdV3ServiceDiscovery) GetInstances(serviceName string) []registry.Ser // GetInstancesByPage will return a page containing instances of ServiceInstance with the serviceName // the page will start at offset func (e *etcdV3ServiceDiscovery) GetInstancesByPage(serviceName string, offset int, pageSize int) gxpage.Pager { - all := e.GetInstances(serviceName) res := make([]interface{}, 0, pageSize) @@ -253,7 +248,6 @@ func toParentPath(serviceName string) string { // register service watcher func (e *etcdV3ServiceDiscovery) registerSreviceWatcher(serviceName string) error { - initLock.Lock() defer initLock.Unlock() @@ -273,7 +267,6 @@ func (e *etcdV3ServiceDiscovery) registerSreviceWatcher(serviceName string) erro // when child data change should DispatchEventByServiceName func (e *etcdV3ServiceDiscovery) DataChange(eventType remoting.Event) bool { - if eventType.Action == remoting.EventTypeUpdate { instance := ®istry.DefaultServiceInstance{} err := jsonutil.DecodeJSON([]byte(eventType.Content), &instance) @@ -291,7 +284,6 @@ func (e *etcdV3ServiceDiscovery) DataChange(eventType remoting.Event) bool { // netEcdv3ServiceDiscovery func newEtcdV3ServiceDiscovery(name string) (registry.ServiceDiscovery, error) { - initLock.Lock() defer initLock.Unlock() diff --git a/registry/event/customizable_service_instance_listener.go b/registry/event/customizable_service_instance_listener.go index 07e84c1454..65e56e60ae 100644 --- a/registry/event/customizable_service_instance_listener.go +++ b/registry/event/customizable_service_instance_listener.go @@ -32,8 +32,7 @@ func init() { } // customizableServiceInstanceListener is singleton -type customizableServiceInstanceListener struct { -} +type customizableServiceInstanceListener struct{} // GetPriority return priority 9999, // 9999 is big enough to make sure it will be last invoked diff --git a/registry/event/customizable_service_instance_listener_test.go b/registry/event/customizable_service_instance_listener_test.go index 1c81ece498..b2dcd93fcc 100644 --- a/registry/event/customizable_service_instance_listener_test.go +++ b/registry/event/customizable_service_instance_listener_test.go @@ -32,7 +32,6 @@ import ( ) func TestGetCustomizableServiceInstanceListener(t *testing.T) { - prepareMetadataServiceForTest() cus := GetCustomizableServiceInstanceListener() @@ -50,8 +49,7 @@ func TestGetCustomizableServiceInstanceListener(t *testing.T) { assert.NotNil(t, tp) } -type mockEvent struct { -} +type mockEvent struct{} func (m *mockEvent) String() string { panic("implement me") @@ -65,8 +63,7 @@ func (m *mockEvent) GetTimestamp() time.Time { panic("implement me") } -type mockCustomizer struct { -} +type mockCustomizer struct{} func (m *mockCustomizer) GetPriority() int { return 0 diff --git a/registry/event/event_publishing_service_deiscovery_test.go b/registry/event/event_publishing_service_deiscovery_test.go index 504f7b5fae..4979f1d804 100644 --- a/registry/event/event_publishing_service_deiscovery_test.go +++ b/registry/event/event_publishing_service_deiscovery_test.go @@ -40,7 +40,6 @@ import ( ) func TestEventPublishingServiceDiscovery_DispatchEvent(t *testing.T) { - // extension.SetMetadataService("local", inmemory.NewMetadataService) config.GetApplicationConfig().MetadataType = "local" @@ -69,7 +68,6 @@ func TestEventPublishingServiceDiscovery_DispatchEvent(t *testing.T) { si := ®istry.DefaultServiceInstance{Id: "testServiceInstance"} err = dc.Register(si) assert.Nil(t, err) - } type TestServiceDiscoveryDestroyingEventListener struct { @@ -113,8 +111,7 @@ func (tel *TestServiceInstancePreRegisteredEventListener) GetEventType() reflect return reflect.TypeOf(ServiceInstancePreRegisteredEvent{}) } -type ServiceDiscoveryA struct { -} +type ServiceDiscoveryA struct{} // String return mockServiceDiscovery func (msd *ServiceDiscoveryA) String() string { @@ -178,8 +175,7 @@ func (msd *ServiceDiscoveryA) DispatchEvent(event *registry.ServiceInstancesChan return nil } -type mockServiceNameMapping struct { -} +type mockServiceNameMapping struct{} func (m *mockServiceNameMapping) Map(serviceInterface string, group string, version string, protocol string) error { return nil diff --git a/registry/event/event_publishing_service_discovery.go b/registry/event/event_publishing_service_discovery.go index 773eee6e83..6c418c1390 100644 --- a/registry/event/event_publishing_service_discovery.go +++ b/registry/event/event_publishing_service_discovery.go @@ -64,7 +64,6 @@ func (epsd *EventPublishingServiceDiscovery) Register(instance registry.ServiceI } return epsd.executeWithEvents(NewServiceInstancePreRegisteredEvent(epsd.serviceDiscovery, instance), f, NewServiceInstanceRegisteredEvent(epsd.serviceDiscovery, instance)) - } // Update returns the result of serviceDiscovery.Update diff --git a/registry/event/log_event_listener.go b/registry/event/log_event_listener.go index 0781a6d6db..c73ff29ab3 100644 --- a/registry/event/log_event_listener.go +++ b/registry/event/log_event_listener.go @@ -33,8 +33,7 @@ func init() { } // logEventListener is singleton -type logEventListener struct { -} +type logEventListener struct{} func (l *logEventListener) GetPriority() int { return 0 @@ -49,8 +48,10 @@ func (l *logEventListener) GetEventType() reflect.Type { return reflect.TypeOf(&observer.BaseEvent{}) } -var logEventListenerInstance *logEventListener -var logEventListenerOnce sync.Once +var ( + logEventListenerInstance *logEventListener + logEventListenerOnce sync.Once +) func GetLogEventListener() observer.EventListener { logEventListenerOnce.Do(func() { diff --git a/registry/event/metadata_service_url_params_customizer.go b/registry/event/metadata_service_url_params_customizer.go index 6d8f99b327..2274cacab8 100644 --- a/registry/event/metadata_service_url_params_customizer.go +++ b/registry/event/metadata_service_url_params_customizer.go @@ -42,7 +42,6 @@ func init() { // remove TIMESTAMP_KEY because it's nonsense constant.TIMESTAMP_KEY) extension.AddCustomizers(&metadataServiceURLParamsMetadataCustomizer{exceptKeys: exceptKeys}) - } type metadataServiceURLParamsMetadataCustomizer struct { @@ -79,7 +78,6 @@ func (m *metadataServiceURLParamsMetadataCustomizer) Customize(instance registry } func (m *metadataServiceURLParamsMetadataCustomizer) convertToParams(urls []interface{}) map[string]map[string]string { - // usually there will be only one protocol res := make(map[string]map[string]string, 1) // those keys are useless diff --git a/registry/event/metadata_service_url_params_customizer_test.go b/registry/event/metadata_service_url_params_customizer_test.go index c041232b78..690c95dd95 100644 --- a/registry/event/metadata_service_url_params_customizer_test.go +++ b/registry/event/metadata_service_url_params_customizer_test.go @@ -44,7 +44,6 @@ func prepareMetadataServiceForTest() { } func TestMetadataServiceURLParamsMetadataCustomizer(t *testing.T) { - prepareMetadataServiceForTest() msup := &metadataServiceURLParamsMetadataCustomizer{exceptKeys: gxset.NewSet()} diff --git a/registry/event/protocol_ports_metadata_customizer.go b/registry/event/protocol_ports_metadata_customizer.go index a58471c2bd..8f401493b0 100644 --- a/registry/event/protocol_ports_metadata_customizer.go +++ b/registry/event/protocol_ports_metadata_customizer.go @@ -35,8 +35,7 @@ func init() { } // ProtocolPortsMetadataCustomizer will update the endpoints -type ProtocolPortsMetadataCustomizer struct { -} +type ProtocolPortsMetadataCustomizer struct{} // GetPriority will return 0, which means it will be invoked at the beginning func (p *ProtocolPortsMetadataCustomizer) GetPriority() int { diff --git a/registry/event/service_revision_customizer.go b/registry/event/service_revision_customizer.go index 4793e91948..5d9668c412 100644 --- a/registry/event/service_revision_customizer.go +++ b/registry/event/service_revision_customizer.go @@ -39,8 +39,7 @@ func init() { extension.AddCustomizers(&subscribedServicesRevisionMetadataCustomizer{}) } -type exportedServicesRevisionMetadataCustomizer struct { -} +type exportedServicesRevisionMetadataCustomizer struct{} // GetPriority will return 1 so that it will be invoked in front of user defining Customizer func (e *exportedServicesRevisionMetadataCustomizer) GetPriority() int { @@ -56,7 +55,6 @@ func (e *exportedServicesRevisionMetadataCustomizer) Customize(instance registry } urls, err := ms.GetExportedURLs(constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE, constant.ANY_VALUE) - if err != nil { logger.Errorf("could not find the exported url", err) } @@ -68,8 +66,7 @@ func (e *exportedServicesRevisionMetadataCustomizer) Customize(instance registry instance.GetMetadata()[constant.EXPORTED_SERVICES_REVISION_PROPERTY_NAME] = revision } -type subscribedServicesRevisionMetadataCustomizer struct { -} +type subscribedServicesRevisionMetadataCustomizer struct{} // GetPriority will return 2 so that it will be invoked in front of user defining Customizer func (e *subscribedServicesRevisionMetadataCustomizer) GetPriority() int { @@ -85,7 +82,6 @@ func (e *subscribedServicesRevisionMetadataCustomizer) Customize(instance regist } urls, err := ms.GetSubscribedURLs() - if err != nil { logger.Errorf("could not find the subscribed url", err) } diff --git a/registry/file/listener.go b/registry/file/listener.go index 3fe7400226..5d2193a946 100644 --- a/registry/file/listener.go +++ b/registry/file/listener.go @@ -20,10 +20,8 @@ package file import "github.com/apache/dubbo-go/config_center" // RegistryConfigurationListener represent the processor of flie watcher -type RegistryConfigurationListener struct { -} +type RegistryConfigurationListener struct{} // Process submit the ConfigChangeEvent to the event chan to notify all observer func (l *RegistryConfigurationListener) Process(configType *config_center.ConfigChangeEvent) { - } diff --git a/registry/file/service_discovery.go b/registry/file/service_discovery.go index 768a1c2a3d..f68498d30f 100644 --- a/registry/file/service_discovery.go +++ b/registry/file/service_discovery.go @@ -265,7 +265,7 @@ func (fssd *fileSystemServiceDiscovery) GetRequestInstances(serviceNames []strin // AddListener adds a new ServiceInstancesChangedListener // client func (fssd *fileSystemServiceDiscovery) AddListener(listener *registry.ServiceInstancesChangedListener) error { - //fssd.dynamicConfiguration.AddListener(listener.ServiceName) + // fssd.dynamicConfiguration.AddListener(listener.ServiceName) return nil } diff --git a/registry/file/service_discovery_test.go b/registry/file/service_discovery_test.go index 0062eae32c..ee2ad27227 100644 --- a/registry/file/service_discovery_test.go +++ b/registry/file/service_discovery_test.go @@ -35,9 +35,7 @@ import ( "github.com/apache/dubbo-go/registry" ) -var ( - testName = "test" -) +var testName = "test" func TestNewFileSystemServiceDiscoveryAndDestroy(t *testing.T) { prepareData() diff --git a/registry/kubernetes/listener.go b/registry/kubernetes/listener.go index e20b7c7e7d..9b8075cddf 100644 --- a/registry/kubernetes/listener.go +++ b/registry/kubernetes/listener.go @@ -51,7 +51,6 @@ func (l *dataListener) AddInterestedURL(url *common.URL) { // DataChange // notify listen, when interest event func (l *dataListener) DataChange(eventType remoting.Event) bool { - index := strings.Index(eventType.Path, "/providers/") if index == -1 { logger.Warnf("Listen with no url, event.path={%v}", eventType.Path) diff --git a/registry/kubernetes/listener_test.go b/registry/kubernetes/listener_test.go index ef6e8fb1fc..e70c15d518 100644 --- a/registry/kubernetes/listener_test.go +++ b/registry/kubernetes/listener_test.go @@ -44,7 +44,6 @@ type MockDataListener struct{} func (*MockDataListener) Process(configType *config_center.ConfigChangeEvent) {} func TestDataChange(t *testing.T) { - listener := NewRegistryDataListener(&MockDataListener{}) url, _ := common.NewURL("jsonrpc%3A%2F%2F127.0.0.1%3A20001%2Fcom.ikurento.user.UserProvider%3Fanyhost%3Dtrue%26app.version%3D0.0.1%26application%3DBDTService%26category%3Dproviders%26cluster%3Dfailover%26dubbo%3Ddubbo-provider-golang-2.6.0%26environment%3Ddev%26group%3D%26interface%3Dcom.ikurento.user.UserProvider%26ip%3D10.32.20.124%26loadbalance%3Drandom%26methods.GetUser.loadbalance%3Drandom%26methods.GetUser.retries%3D1%26methods.GetUser.weight%3D0%26module%3Ddubbogo%2Buser-info%2Bserver%26name%3DBDTService%26organization%3Dikurento.com%26owner%3DZX%26pid%3D74500%26retries%3D0%26service.filter%3Decho%26side%3Dprovider%26timestamp%3D1560155407%26version%3D%26warmup%3D100") listener.AddInterestedURL(url) diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go index a26478f2ee..9be6387587 100644 --- a/registry/kubernetes/registry.go +++ b/registry/kubernetes/registry.go @@ -46,8 +46,8 @@ const ( ) func init() { - //processID = fmt.Sprintf("%d", os.Getpid()) - //localIP = common.GetLocalIp() + // processID = fmt.Sprintf("%d", os.Getpid()) + // localIP = common.GetLocalIp() extension.SetRegistry(Name, newKubernetesRegistry) } @@ -84,7 +84,6 @@ func (r *kubernetesRegistry) CloseAndNilClient() { // CloseListener closes listeners func (r *kubernetesRegistry) CloseListener() { - r.cltLock.Lock() l := r.configListener r.cltLock.Unlock() @@ -113,10 +112,7 @@ func (r *kubernetesRegistry) DoUnregister(root string, node string) error { // DoSubscribe actually subscribe the provider URL func (r *kubernetesRegistry) DoSubscribe(svc *common.URL) (registry.Listener, error) { - - var ( - configListener *configurationListener - ) + var configListener *configurationListener r.listenerLock.Lock() configListener = r.configListener @@ -137,7 +133,7 @@ func (r *kubernetesRegistry) DoSubscribe(svc *common.URL) (registry.Listener, er r.listenerLock.Unlock() } - //register the svc to dataListener + // register the svc to dataListener r.dataListener.AddInterestedURL(svc) go r.listener.ListenServiceEvent(fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, svc.Service()), r.dataListener) @@ -157,7 +153,6 @@ func (r *kubernetesRegistry) InitListeners() { } func newKubernetesRegistry(url *common.URL) (registry.Registry, error) { - // actually, kubernetes use in-cluster config, r := &kubernetesRegistry{} @@ -196,7 +191,6 @@ func newMockKubernetesRegistry( // HandleClientRestart will reconnect to kubernetes registry center func (r *kubernetesRegistry) HandleClientRestart() { - var ( err error failTimes int diff --git a/registry/kubernetes/registry_test.go b/registry/kubernetes/registry_test.go index a816b035c5..7200dd593f 100644 --- a/registry/kubernetes/registry_test.go +++ b/registry/kubernetes/registry_test.go @@ -202,7 +202,6 @@ var clientPodListJsonData = `{ ` func getTestRegistry(t *testing.T) *kubernetesRegistry { - const ( podNameKey = "HOSTNAME" nameSpaceKey = "NAMESPACE" @@ -240,7 +239,6 @@ func getTestRegistry(t *testing.T) *kubernetesRegistry { } func TestRegister(t *testing.T) { - r := getTestRegistry(t) defer r.Destroy() @@ -259,7 +257,6 @@ func TestRegister(t *testing.T) { } func TestSubscribe(t *testing.T) { - r := getTestRegistry(t) defer r.Destroy() @@ -276,7 +273,6 @@ func TestSubscribe(t *testing.T) { wg := sync.WaitGroup{} wg.Add(1) go func() { - defer wg.Done() registerErr := r.Register(url) if registerErr != nil { @@ -294,7 +290,6 @@ func TestSubscribe(t *testing.T) { } func TestConsumerDestroy(t *testing.T) { - r := getTestRegistry(t) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", @@ -306,16 +301,14 @@ func TestConsumerDestroy(t *testing.T) { t.Fatal(err) } - //listener.Close() + // listener.Close() time.Sleep(1e9) r.Destroy() assert.Equal(t, false, r.IsAvailable()) - } func TestProviderDestroy(t *testing.T) { - r := getTestRegistry(t) url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", @@ -330,7 +323,6 @@ func TestProviderDestroy(t *testing.T) { } func TestNewRegistry(t *testing.T) { - regUrl, err := common.NewURL("registry://127.0.0.1:443", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) if err != nil { @@ -343,7 +335,6 @@ func TestNewRegistry(t *testing.T) { } func TestHandleClientRestart(t *testing.T) { - r := getTestRegistry(t) r.WaitGroup().Add(1) go r.HandleClientRestart() diff --git a/registry/mock_registry.go b/registry/mock_registry.go index 6287bb0d16..953f42889a 100644 --- a/registry/mock_registry.go +++ b/registry/mock_registry.go @@ -141,7 +141,6 @@ func (l *listener) Next() (*ServiceEvent, error) { } func (*listener) Close() { - } // nolint diff --git a/registry/nacos/registry.go b/registry/nacos/registry.go index e9a4bd317e..4bc88d71b1 100644 --- a/registry/nacos/registry.go +++ b/registry/nacos/registry.go @@ -41,9 +41,7 @@ import ( "github.com/apache/dubbo-go/registry" ) -var ( - localIP = "" -) +var localIP = "" const ( // RegistryConnDelay registry connection delay @@ -293,7 +291,7 @@ func getNacosConfig(url *common.URL) (map[string]interface{}, error) { clientConfig.Endpoint = url.GetParam(constant.NACOS_ENDPOINT, "") clientConfig.NamespaceId = url.GetParam(constant.NACOS_NAMESPACE_ID, "") - //enable local cache when nacos can not connect. + // enable local cache when nacos can not connect. notLoadCache, err := strconv.ParseBool(url.GetParam(constant.NACOS_NOT_LOAD_LOCAL_CACHE, "false")) if err != nil { logger.Errorf("ParseBool - error: %v", err) diff --git a/registry/nacos/registry_test.go b/registry/nacos/registry_test.go index b828205771..ab770fb8df 100644 --- a/registry/nacos/registry_test.go +++ b/registry/nacos/registry_test.go @@ -114,7 +114,6 @@ func TestNacosRegistry_Subscribe(t *testing.T) { } t.Logf("serviceEvent:%+v \n", serviceEvent) assert.Regexp(t, ".*ServiceEvent{Action{add}.*", serviceEvent.String()) - } func TestNacosRegistry_Subscribe_del(t *testing.T) { @@ -178,9 +177,11 @@ func TestNacosRegistry_Subscribe_del(t *testing.T) { assert.Regexp(t, ".*ServiceEvent{Action{add}.*", serviceEvent2.String()) nacosReg := reg.(*nacosRegistry) - //deregister instance to mock instance offline - _, err = nacosReg.namingClient.DeregisterInstance(vo.DeregisterInstanceParam{Ip: "127.0.0.2", Port: 20000, - ServiceName: "providers:com.ikurento.user.UserProvider:2.0.0:guangzhou-idc"}) + // deregister instance to mock instance offline + _, err = nacosReg.namingClient.DeregisterInstance(vo.DeregisterInstanceParam{ + Ip: "127.0.0.2", Port: 20000, + ServiceName: "providers:com.ikurento.user.UserProvider:2.0.0:guangzhou-idc", + }) assert.NoError(t, err) serviceEvent3, _ := listener.Next() diff --git a/registry/nacos/service_discovery.go b/registry/nacos/service_discovery.go index 4533e7bc6b..785e39579e 100644 --- a/registry/nacos/service_discovery.go +++ b/registry/nacos/service_discovery.go @@ -308,7 +308,6 @@ var ( // newNacosServiceDiscovery will create new service discovery instance // use double-check pattern to reduce race condition func newNacosServiceDiscovery(name string) (registry.ServiceDiscovery, error) { - instance, ok := instanceMap[name] if ok { return instance, nil diff --git a/registry/nacos/service_discovery_test.go b/registry/nacos/service_discovery_test.go index b6902ed778..a9bc27bcfc 100644 --- a/registry/nacos/service_discovery_test.go +++ b/registry/nacos/service_discovery_test.go @@ -37,9 +37,7 @@ import ( "github.com/apache/dubbo-go/registry" ) -var ( - testName = "test" -) +var testName = "test" func Test_newNacosServiceDiscovery(t *testing.T) { name := "nacos1" @@ -67,7 +65,6 @@ func Test_newNacosServiceDiscovery(t *testing.T) { res, err := newNacosServiceDiscovery(name) assert.Nil(t, err) assert.NotNil(t, res) - } func TestNacosServiceDiscovery_Destroy(t *testing.T) { @@ -121,8 +118,8 @@ func TestNacosServiceDiscovery_CRUD(t *testing.T) { err = serviceDiscovery.Register(instance) assert.Nil(t, err) - //sometimes nacos may be failed to push update of instance, - //so it need 10s to pull, we sleep 10 second to make sure instance has been update + // sometimes nacos may be failed to push update of instance, + // so it need 10s to pull, we sleep 10 second to make sure instance has been update time.Sleep(11 * time.Second) page := serviceDiscovery.GetHealthyInstancesByPage(serviceName, 0, 10, true) assert.NotNil(t, page) @@ -136,7 +133,7 @@ func TestNacosServiceDiscovery_CRUD(t *testing.T) { assert.Equal(t, host, instance.GetHost()) assert.Equal(t, port, instance.GetPort()) // TODO: console.nacos.io has updated to nacos 2.0 and serviceName has changed in 2.0, so ignore temporarily. - //assert.Equal(t, serviceName, instance.GetServiceName()) + // assert.Equal(t, serviceName, instance.GetServiceName()) assert.Equal(t, 0, len(instance.GetMetadata())) instance.Metadata["a"] = "b" diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index 4fcdf93c0f..3e6e62967d 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -131,8 +131,8 @@ func (proto *registryProtocol) GetRegistries() []registry.Registry { // Refer provider service from registry center func (proto *registryProtocol) Refer(url *common.URL) protocol.Invoker { - var registryUrl = url - var serviceUrl = registryUrl.SubURL + registryUrl := url + serviceUrl := registryUrl.SubURL if registryUrl.Protocol == constant.REGISTRY_PROTOCOL { registryUrl.Protocol = registryUrl.GetParam(constant.REGISTRY_KEY, "") } diff --git a/registry/protocol/protocol_test.go b/registry/protocol/protocol_test.go index 0fca55221d..c42590517d 100644 --- a/registry/protocol/protocol_test.go +++ b/registry/protocol/protocol_test.go @@ -138,7 +138,6 @@ func exporterNormal(t *testing.T, regProtocol *registryProtocol) *common.URL { } func TestExporter(t *testing.T) { - regProtocol := newRegistryProtocol() exporterNormal(t, regProtocol) } @@ -295,5 +294,4 @@ func TestGetProviderUrlWithHideKey(t *testing.T) { assert.NotContains(t, providerUrl.GetParams(), ".c") assert.NotContains(t, providerUrl.GetParams(), ".d") assert.Contains(t, providerUrl.GetParams(), "a") - } diff --git a/registry/servicediscovery/instance/random/random_service_instance_selector.go b/registry/servicediscovery/instance/random/random_service_instance_selector.go index 7e4e0eefbb..95ca185850 100644 --- a/registry/servicediscovery/instance/random/random_service_instance_selector.go +++ b/registry/servicediscovery/instance/random/random_service_instance_selector.go @@ -33,9 +33,8 @@ func init() { extension.SetServiceInstanceSelector("random", NewRandomServiceInstanceSelector) } -//the ServiceInstanceSelector implementation based on Random algorithm -type RandomServiceInstanceSelector struct { -} +// the ServiceInstanceSelector implementation based on Random algorithm +type RandomServiceInstanceSelector struct{} func NewRandomServiceInstanceSelector() instance.ServiceInstanceSelector { return &RandomServiceInstanceSelector{} @@ -51,5 +50,4 @@ func (r *RandomServiceInstanceSelector) Select(url *common.URL, serviceInstances rand.Seed(time.Now().UnixNano()) index := rand.Intn(len(serviceInstances)) return serviceInstances[index] - } diff --git a/registry/servicediscovery/instance/service_instance_selector.go b/registry/servicediscovery/instance/service_instance_selector.go index 5690ab6c90..a5ad3db41c 100644 --- a/registry/servicediscovery/instance/service_instance_selector.go +++ b/registry/servicediscovery/instance/service_instance_selector.go @@ -23,6 +23,6 @@ import ( ) type ServiceInstanceSelector interface { - //Select an instance of ServiceInstance by the specified ServiceInstance service instances + // Select an instance of ServiceInstance by the specified ServiceInstance service instances Select(url *common.URL, serviceInstances []registry.ServiceInstance) registry.ServiceInstance } diff --git a/registry/servicediscovery/service_discovery_registry.go b/registry/servicediscovery/service_discovery_registry.go index c97a7f7b51..e3f2af3cc1 100644 --- a/registry/servicediscovery/service_discovery_registry.go +++ b/registry/servicediscovery/service_discovery_registry.go @@ -73,7 +73,6 @@ type serviceDiscoveryRegistry struct { } func newServiceDiscoveryRegistry(url *common.URL) (registry.Registry, error) { - tryInitMetadataService(url) serviceDiscovery, err := creatServiceDiscovery(url) @@ -131,7 +130,7 @@ func parseServices(literalServices string) *gxset.HashSet { if len(literalServices) == 0 { return set } - var splitServices = strings.Split(literalServices, ",") + splitServices := strings.Split(literalServices, ",") for _, s := range splitServices { if len(s) != 0 { set.Add(s) @@ -165,7 +164,6 @@ func (s *serviceDiscoveryRegistry) Register(url *common.URL) error { return nil } ok, err := s.metaDataService.ExportURL(url) - if err != nil { logger.Errorf("The URL[%s] registry catch error:%s!", url.String(), err.Error()) return err @@ -226,7 +224,6 @@ func (s *serviceDiscoveryRegistry) registerServiceInstancesChangedListener(url * logger.Errorf("add listener[%s] catch error,url:%s err:%s", listenerId, url.String(), err.Error()) } } - } func getUrlKey(url *common.URL) string { @@ -274,7 +271,6 @@ func (s *serviceDiscoveryRegistry) subscribe(url *common.URL, notify registry.No Service: url, }) } - } func (s *serviceDiscoveryRegistry) synthesizeSubscribedURLs(subscribedURL *common.URL, serviceInstances []registry.ServiceInstance) []*common.URL { @@ -363,7 +359,6 @@ func (s *serviceDiscoveryRegistry) getExportedUrlsByInst(serviceInstance registr for _, ui := range result { u, err := common.NewURL(ui.(string)) - if err != nil { logger.Errorf("could not parse the url string to URL structure: %s", ui.(string), err) continue @@ -522,7 +517,6 @@ func (s *serviceDiscoveryRegistry) cloneExportedURLs(url *common.URL, serviceIns } } return clonedExportedURLs - } type endpoint struct { @@ -549,6 +543,7 @@ func getProtocolPort(serviceInstance registry.ServiceInstance, protocol string) } return -1 } + func (s *serviceDiscoveryRegistry) getTemplateExportedURLs(url *common.URL, serviceInstance registry.ServiceInstance) []*common.URL { exportedURLs := s.getRevisionExportedURLs(serviceInstance) if len(exportedURLs) == 0 { @@ -607,21 +602,17 @@ type InstanceChangeNotify struct { } func (icn *InstanceChangeNotify) Notify(event observer.Event) { - if se, ok := event.(*registry.ServiceInstancesChangedEvent); ok { sdr := icn.serviceDiscoveryRegistry sdr.subscribe(sdr.url.SubURL, icn.notify, se.ServiceName, se.Instances) } } -var ( - exporting = &atomic.Bool{} -) +var exporting = &atomic.Bool{} // tryInitMetadataService will try to initialize metadata service // TODO (move to somewhere) func tryInitMetadataService(url *common.URL) { - ms, err := extension.GetMetadataService(config.GetApplicationConfig().MetadataType) if err != nil { logger.Errorf("could not init metadata service", err) diff --git a/registry/servicediscovery/service_discovery_registry_test.go b/registry/servicediscovery/service_discovery_registry_test.go index 391d92c8ad..6e1f228998 100644 --- a/registry/servicediscovery/service_discovery_registry_test.go +++ b/registry/servicediscovery/service_discovery_registry_test.go @@ -26,6 +26,7 @@ import ( "github.com/dubbogo/gost/hash/page" "github.com/stretchr/testify/assert" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/extension" @@ -83,8 +84,7 @@ func TestServiceDiscoveryRegistry_Register(t *testing.T) { assert.NoError(t, err) } -type mockEventDispatcher struct { -} +type mockEventDispatcher struct{} func (m *mockEventDispatcher) AddEventListener(observer.EventListener) { } @@ -111,8 +111,7 @@ func (m *mockEventDispatcher) RemoveAllEventListeners() { func (m *mockEventDispatcher) Dispatch(observer.Event) { } -type mockServiceNameMapping struct { -} +type mockServiceNameMapping struct{} func (m *mockServiceNameMapping) Map(string, string, string, string) error { return nil @@ -122,8 +121,7 @@ func (m *mockServiceNameMapping) Get(string, string, string, string) (*gxset.Has panic("implement me") } -type mockServiceDiscovery struct { -} +type mockServiceDiscovery struct{} func (m *mockServiceDiscovery) String() string { panic("implement me") @@ -185,8 +183,7 @@ func (m *mockServiceDiscovery) DispatchEvent(*registry.ServiceInstancesChangedEv panic("implement me") } -type mockMetadataService struct { -} +type mockMetadataService struct{} func (m *mockMetadataService) Reference() string { panic("implement me") diff --git a/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go b/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go index c6b3aeaad0..a002aadc22 100644 --- a/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go +++ b/registry/servicediscovery/synthesizer/rest/rest_subscribed_urls_synthesizer.go @@ -33,9 +33,8 @@ func init() { synthesizer.AddSynthesizer(NewRestSubscribedURLsSynthesizer()) } -//SubscribedURLsSynthesizer implementation for rest protocol -type RestSubscribedURLsSynthesizer struct { -} +// SubscribedURLsSynthesizer implementation for rest protocol +type RestSubscribedURLsSynthesizer struct{} func (r RestSubscribedURLsSynthesizer) Support(subscribedURL *common.URL) bool { return "rest" == subscribedURL.Protocol diff --git a/registry/zookeeper/listener.go b/registry/zookeeper/listener.go index 7e47717661..a7bc30230d 100644 --- a/registry/zookeeper/listener.go +++ b/registry/zookeeper/listener.go @@ -20,6 +20,8 @@ package zookeeper import ( "strings" "sync" + + gxzookeeper "github.com/dubbogo/gost/database/kv/zk" ) import ( @@ -45,7 +47,8 @@ type RegistryDataListener struct { // NewRegistryDataListener constructs a new RegistryDataListener func NewRegistryDataListener() *RegistryDataListener { return &RegistryDataListener{ - subscribed: make(map[string]config_center.ConfigurationListener)} + subscribed: make(map[string]config_center.ConfigurationListener), + } } // SubscribeURL is used to set a watch listener for url @@ -131,7 +134,8 @@ func NewRegistryConfigurationListener(client *gxzookeeper.ZookeeperClient, reg * events: make(chan *config_center.ConfigChangeEvent, 32), isClosed: false, close: make(chan struct{}, 1), - subscribeURL: conf} + subscribeURL: conf, + } } // Process submit the ConfigChangeEvent to the event chan to notify all observer diff --git a/registry/zookeeper/listener_test.go b/registry/zookeeper/listener_test.go index cc8d90ed10..f5d905118a 100644 --- a/registry/zookeeper/listener_test.go +++ b/registry/zookeeper/listener_test.go @@ -40,8 +40,7 @@ func Test_DataChange(t *testing.T) { assert.Equal(t, true, int) } -type MockConfigurationListener struct { -} +type MockConfigurationListener struct{} func (*MockConfigurationListener) Process(configType *config_center.ConfigChangeEvent) { } diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index 8b21aaed73..bef0ae5bb2 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -60,7 +60,7 @@ type zkRegistry struct { listener *zookeeper.ZkEventListener dataListener *RegistryDataListener cltLock sync.Mutex - //for provider + // for provider zkPath map[string]int // key = protocol://ip:port/interface } @@ -101,7 +101,7 @@ func newMockZkRegistry(url *common.URL, opts ...gxzookeeper.Option) (*zk.TestClu err error r *zkRegistry c *zk.TestCluster - //event <-chan zk.Event + // event <-chan zk.Event ) r = &zkRegistry{ @@ -112,7 +112,7 @@ func newMockZkRegistry(url *common.URL, opts ...gxzookeeper.Option) (*zk.TestClu if err != nil { return nil, nil, err } - r.WaitGroup().Add(1) //zk client start successful, then wg +1 + r.WaitGroup().Add(1) // zk client start successful, then wg +1 go zookeeper.HandleClientRestart(r) r.InitListeners() return c, r, nil @@ -243,7 +243,6 @@ func (r *zkRegistry) registerTempZookeeperNode(root string, node string) error { } func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListener, error) { - var zkListener *RegistryConfigurationListener dataListener := r.dataListener ttl := r.GetParam(constant.REGISTRY_TTL_KEY, constant.DEFAULT_REG_TTL) @@ -280,7 +279,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen r.listenerLock.Unlock() } - //Interested register to dataconfig. + // Interested register to dataconfig. r.dataListener.SubscribeURL(conf, zkListener) go r.listener.ListenServiceEvent(conf, fmt.Sprintf("/dubbo/%s/"+constant.DEFAULT_CATEGORY, url.QueryEscape(conf.Service())), r.dataListener) @@ -289,7 +288,6 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen } func (r *zkRegistry) getCloseListener(conf *common.URL) (*RegistryConfigurationListener, error) { - var zkListener *RegistryConfigurationListener r.dataListener.mutex.Lock() configurationListener := r.dataListener.subscribed[conf.ServiceKey()] @@ -308,7 +306,7 @@ func (r *zkRegistry) getCloseListener(conf *common.URL) (*RegistryConfigurationL return nil, perrors.New("listener is null can not close.") } - //Interested register to dataconfig. + // Interested register to dataconfig. r.listenerLock.Lock() listener := r.listener r.listener = nil diff --git a/registry/zookeeper/registry_test.go b/registry/zookeeper/registry_test.go index 9e52dd70c3..172ffec1e5 100644 --- a/registry/zookeeper/registry_test.go +++ b/registry/zookeeper/registry_test.go @@ -81,7 +81,7 @@ func Test_Subscribe(t *testing.T) { url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) ts, reg, _ := newMockZkRegistry(regURL) - //provider register + // provider register err := reg.Register(url) assert.NoError(t, err) @@ -89,7 +89,7 @@ func Test_Subscribe(t *testing.T) { return } - //consumer register + // consumer register regURL.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) _, reg2, _ := newMockZkRegistry(regURL, gxzookeeper.WithTestCluster(ts)) @@ -113,7 +113,7 @@ func Test_UnSubscribe(t *testing.T) { url, _ := common.NewURL("dubbo://127.0.0.1:20000/com.ikurento.user.UserProvider", common.WithParamsValue(constant.CLUSTER_KEY, "mock"), common.WithMethods([]string{"GetUser", "AddUser"})) ts, reg, _ := newMockZkRegistry(regURL) - //provider register + // provider register err := reg.Register(url) assert.NoError(t, err) @@ -121,7 +121,7 @@ func Test_UnSubscribe(t *testing.T) { return } - //consumer register + // consumer register regURL.SetParam(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER)) _, reg2, _ := newMockZkRegistry(regURL, gxzookeeper.WithTestCluster(ts)) @@ -159,7 +159,7 @@ func Test_ConsumerDestroy(t *testing.T) { _, err = reg.DoSubscribe(url) assert.NoError(t, err) - //listener.Close() + // listener.Close() time.Sleep(1e9) reg.Destroy() assert.Equal(t, false, reg.IsAvailable()) @@ -178,7 +178,7 @@ func Test_ProviderDestroy(t *testing.T) { err = reg.Register(url) assert.Nil(t, err) - //listener.Close() + // listener.Close() time.Sleep(1e9) reg.Destroy() assert.Equal(t, false, reg.IsAvailable()) diff --git a/registry/zookeeper/service_discovery.go b/registry/zookeeper/service_discovery.go index 06fe0f7f24..67c89a0d10 100644 --- a/registry/zookeeper/service_discovery.go +++ b/registry/zookeeper/service_discovery.go @@ -63,7 +63,7 @@ func init() { type zookeeperServiceDiscovery struct { client *gxzookeeper.ZookeeperClient csd *curator_discovery.ServiceDiscovery - //listener *zookeeper.ZkEventListener + // listener *zookeeper.ZkEventListener url *common.URL wg sync.WaitGroup cltLock sync.Mutex @@ -112,7 +112,7 @@ func newZookeeperServiceDiscovery(name string) (registry.ServiceDiscovery, error if err != nil { return nil, err } - zksd.WaitGroup().Add(1) //zk client start successful, then wg +1 + zksd.WaitGroup().Add(1) // zk client start successful, then wg +1 go zookeeper.HandleClientRestart(zksd) zksd.csd = curator_discovery.NewServiceDiscovery(zksd.client, rootPath) return zksd, nil diff --git a/remoting/codec.go b/remoting/codec.go index 607d1643cc..30e630971d 100644 --- a/remoting/codec.go +++ b/remoting/codec.go @@ -32,9 +32,7 @@ type DecodeResult struct { Result interface{} } -var ( - codec = make(map[string]Codec, 2) -) +var codec = make(map[string]Codec, 2) func RegistryCodec(protocol string, codecTmp Codec) { codec[protocol] = codecTmp diff --git a/remoting/etcdv3/client_test.go b/remoting/etcdv3/client_test.go index 787c24d45f..4f4fa21dad 100644 --- a/remoting/etcdv3/client_test.go +++ b/remoting/etcdv3/client_test.go @@ -84,7 +84,6 @@ type ClientTestSuite struct { // start etcd server func (suite *ClientTestSuite) SetupSuite() { - t := suite.T() DefaultListenPeerURLs := "http://localhost:2382" @@ -138,7 +137,6 @@ func (suite *ClientTestSuite) SetupTest() { } func (suite *ClientTestSuite) TestClientClose() { - c := suite.client t := suite.T() @@ -149,7 +147,6 @@ func (suite *ClientTestSuite) TestClientClose() { } func (suite *ClientTestSuite) TestClientValid() { - c := suite.client t := suite.T() @@ -163,7 +160,6 @@ func (suite *ClientTestSuite) TestClientValid() { } func (suite *ClientTestSuite) TestClientDone() { - c := suite.client go func() { @@ -179,7 +175,6 @@ func (suite *ClientTestSuite) TestClientDone() { } func (suite *ClientTestSuite) TestClientCreateKV() { - tests := tests c := suite.client @@ -210,7 +205,6 @@ func (suite *ClientTestSuite) TestClientCreateKV() { } func (suite *ClientTestSuite) TestClientDeleteKV() { - tests := tests c := suite.client t := suite.T() @@ -240,11 +234,9 @@ func (suite *ClientTestSuite) TestClientDeleteKV() { t.Fatal(err) } } - } func (suite *ClientTestSuite) TestClientGetChildrenKVList() { - tests := tests c := suite.client @@ -278,11 +270,9 @@ func (suite *ClientTestSuite) TestClientGetChildrenKVList() { } t.Fatalf("expect keylist %v but got %v expect valueList %v but got %v ", expectKList, kList, expectVList, vList) - } func (suite *ClientTestSuite) TestClientWatch() { - tests := tests c := suite.client @@ -292,7 +282,6 @@ func (suite *ClientTestSuite) TestClientWatch() { wg.Add(1) go func() { - defer wg.Done() wc, err := c.watch(prefix) @@ -304,7 +293,6 @@ func (suite *ClientTestSuite) TestClientWatch() { var eCreate, eDelete mvccpb.Event for e := range wc { - for _, event := range e.Events { events = append(events, (mvccpb.Event)(*event)) if event.Type == mvccpb.PUT { @@ -339,11 +327,9 @@ func (suite *ClientTestSuite) TestClientWatch() { c.Close() wg.Wait() - } func (suite *ClientTestSuite) TestClientRegisterTemp() { - c := suite.client observeC := suite.setUpClient() t := suite.T() @@ -364,7 +350,6 @@ func (suite *ClientTestSuite) TestClientRegisterTemp() { var eCreate, eDelete mvccpb.Event for e := range wc { - for _, event := range e.Events { events = append(events, (mvccpb.Event)(*event)) if event.Type == mvccpb.DELETE { diff --git a/remoting/etcdv3/facade.go b/remoting/etcdv3/facade.go index 614ba9ae3a..7a17691151 100644 --- a/remoting/etcdv3/facade.go +++ b/remoting/etcdv3/facade.go @@ -37,15 +37,14 @@ type clientFacade interface { Client() *Client SetClient(*Client) ClientLock() *sync.Mutex - WaitGroup() *sync.WaitGroup //for wait group control, etcd client listener & etcd client container - Done() chan struct{} //for etcd client control + WaitGroup() *sync.WaitGroup // for wait group control, etcd client listener & etcd client container + Done() chan struct{} // for etcd client control RestartCallBack() bool common.Node } // HandleClientRestart keeps the connection between client and server func HandleClientRestart(r clientFacade) { - var ( err error failTimes int diff --git a/remoting/etcdv3/listener.go b/remoting/etcdv3/listener.go index fd6f958597..23ee727737 100644 --- a/remoting/etcdv3/listener.go +++ b/remoting/etcdv3/listener.go @@ -97,7 +97,6 @@ func (l *EventListener) ListenServiceNodeEvent(key string, listener ...remoting. // return true means the event type is DELETE // return false means the event type is CREATE || UPDATE func (l *EventListener) handleEvents(event *clientv3.Event, listeners ...remoting.DataListener) bool { - logger.Infof("got a etcd event {type: %s, key: %s}", event.Type, event.Kv.Key) switch event.Type { @@ -180,7 +179,6 @@ func timeSecondDuration(sec int) time.Duration { // | // --------> listenServiceNodeEvent func (l *EventListener) ListenServiceEvent(key string, listener remoting.DataListener) { - l.keyMapLock.RLock() _, ok := l.keyMap[key] l.keyMapLock.RUnlock() diff --git a/remoting/etcdv3/listener_test.go b/remoting/etcdv3/listener_test.go index 7da8581973..cfd8bffd0a 100644 --- a/remoting/etcdv3/listener_test.go +++ b/remoting/etcdv3/listener_test.go @@ -52,8 +52,7 @@ var changedData = ` ` func (suite *ClientTestSuite) TestListener() { - - var tests = []struct { + tests := []struct { input struct { k string v string diff --git a/remoting/exchange.go b/remoting/exchange.go index ad136a7c5e..07dc5496f7 100644 --- a/remoting/exchange.go +++ b/remoting/exchange.go @@ -119,7 +119,7 @@ type Options struct { ConnectTimeout time.Duration } -//AsyncCallbackResponse async response for dubbo +// AsyncCallbackResponse async response for dubbo type AsyncCallbackResponse struct { common.CallbackResponse Opts Options diff --git a/remoting/exchange_client.go b/remoting/exchange_client.go index f84cef1fa8..4770285ea5 100644 --- a/remoting/exchange_client.go +++ b/remoting/exchange_client.go @@ -81,14 +81,14 @@ func (cl *ExchangeClient) doInit(url *common.URL) error { return nil } if cl.client.Connect(url) != nil { - //retry for a while + // retry for a while time.Sleep(100 * time.Millisecond) if cl.client.Connect(url) != nil { logger.Errorf("Failed to connect server %+v " + url.Location) return errors.New("Failed to connect server " + url.Location) } } - //FIXME atomic operation + // FIXME atomic operation cl.init = true return nil } diff --git a/remoting/exchange_server.go b/remoting/exchange_server.go index a8d7c73f30..41abe216c2 100644 --- a/remoting/exchange_server.go +++ b/remoting/exchange_server.go @@ -23,9 +23,9 @@ import ( // It is interface of server for network communication. // If you use getty as network communication, you should define GettyServer that implements this interface. type Server interface { - //invoke once for connection + // invoke once for connection Start() - //it is for destroy + // it is for destroy Stop() } diff --git a/remoting/getty/config.go b/remoting/getty/config.go index b6aa08206a..725aa942ba 100644 --- a/remoting/getty/config.go +++ b/remoting/getty/config.go @@ -134,7 +134,8 @@ func GetDefaultClientConfig() ClientConfig { WaitTimeout: "1s", MaxMsgLen: 102400, SessionName: "client", - }} + }, + } } // GetDefaultServerConfig gets server default configuration diff --git a/remoting/getty/dubbo_codec_for_test.go b/remoting/getty/dubbo_codec_for_test.go index 9afc18a9aa..d227eca3ae 100644 --- a/remoting/getty/dubbo_codec_for_test.go +++ b/remoting/getty/dubbo_codec_for_test.go @@ -42,8 +42,7 @@ func init() { remoting.RegistryCodec("dubbo", codec) } -type DubboTestCodec struct { -} +type DubboTestCodec struct{} // encode request for transport func (c *DubboTestCodec) EncodeRequest(request *remoting.Request) (*bytes.Buffer, error) { @@ -123,7 +122,7 @@ func (c *DubboTestCodec) encodeHeartbeartReqeust(request *remoting.Request) (*by // encode response func (c *DubboTestCodec) EncodeResponse(response *remoting.Response) (*bytes.Buffer, error) { - var ptype = impl.PackageResponse + ptype := impl.PackageResponse if response.IsHeartbeat() { ptype = impl.PackageHeartbeat } @@ -184,7 +183,7 @@ func (c *DubboTestCodec) decodeRequest(data []byte) (*remoting.Request, int, err if err != nil { originErr := perrors.Cause(err) if originErr == hessian.ErrHeaderNotEnough || originErr == hessian.ErrBodyNotEnough { - //FIXME + // FIXME return nil, 0, originErr } return request, 0, perrors.WithStack(err) @@ -199,19 +198,19 @@ func (c *DubboTestCodec) decodeRequest(data []byte) (*remoting.Request, int, err // convert params of request req := pkg.Body.(map[string]interface{}) - //invocation := request.Data.(*invocation.RPCInvocation) + // invocation := request.Data.(*invocation.RPCInvocation) var methodName string var args []interface{} attachments := make(map[string]interface{}) if req[impl.DubboVersionKey] != nil { - //dubbo version + // dubbo version request.Version = req[impl.DubboVersionKey].(string) } - //path + // path attachments[constant.PATH_KEY] = pkg.Service.Path - //version + // version attachments[constant.VERSION_KEY] = pkg.Service.Version - //method + // method methodName = pkg.Service.Method args = req[impl.ArgsKey].([]interface{}) attachments = req[impl.AttachmentsKey].(map[string]interface{}) @@ -238,7 +237,7 @@ func (c *DubboTestCodec) decodeResponse(data []byte) (*remoting.Response, int, e } response := &remoting.Response{ ID: pkg.Header.ID, - //Version: pkg.Header., + // Version: pkg.Header., SerialID: pkg.Header.SerialID, Status: pkg.Header.ResponseStatus, Event: (pkg.Header.Type & impl.PackageHeartbeat) != 0, @@ -251,7 +250,7 @@ func (c *DubboTestCodec) decodeResponse(data []byte) (*remoting.Response, int, e } } else { response.Status = hessian.Response_OK - //reply(session, p, hessian.PackageHeartbeat) + // reply(session, p, hessian.PackageHeartbeat) } return response, hessian.HEADER_LENGTH + pkg.Header.BodyLen, error } diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index c32e0c23f4..3b59e9cdec 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -52,7 +52,6 @@ func TestRunSuite(t *testing.T) { } func testRequestOneWay(t *testing.T, svr *Server, url *common.URL, client *Client) { - request := remoting.NewRequest("2.0.2") up := &UserProvider{} invocation := createInvocation("GetUser", nil, nil, []interface{}{[]interface{}{"1", "username"}, up}, @@ -62,7 +61,7 @@ func testRequestOneWay(t *testing.T, svr *Server, url *common.URL, client *Clien request.Data = invocation request.Event = false request.TwoWay = false - //user := &User{} + // user := &User{} err := client.Request(request, 3*time.Second, nil) assert.NoError(t, err) } @@ -169,9 +168,7 @@ func testGetUser0(t *testing.T, c *Client) { } func testGetUser1(t *testing.T, c *Client) { - var ( - err error - ) + var err error request := remoting.NewRequest("2.0.2") invocation := createInvocation("GetUser1", nil, nil, []interface{}{}, []reflect.Value{}) @@ -189,9 +186,7 @@ func testGetUser1(t *testing.T, c *Client) { } func testGetUser2(t *testing.T, c *Client) { - var ( - err error - ) + var err error request := remoting.NewRequest("2.0.2") invocation := createInvocation("GetUser2", nil, nil, []interface{}{}, []reflect.Value{}) @@ -207,9 +202,7 @@ func testGetUser2(t *testing.T, c *Client) { } func testGetUser3(t *testing.T, c *Client) { - var ( - err error - ) + var err error request := remoting.NewRequest("2.0.2") invocation := createInvocation("GetUser3", nil, nil, []interface{}{}, []reflect.Value{}) @@ -230,9 +223,7 @@ func testGetUser3(t *testing.T, c *Client) { } func testGetUser4(t *testing.T, c *Client) { - var ( - err error - ) + var err error request := remoting.NewRequest("2.0.2") invocation := invocation.NewRPCInvocation("GetUser4", []interface{}{[]interface{}{"1", "username"}}, nil) attachment := map[string]string{INTERFACE_KEY: "com.ikurento.user.UserProvider"} @@ -250,9 +241,7 @@ func testGetUser4(t *testing.T, c *Client) { } func testGetUser5(t *testing.T, c *Client) { - var ( - err error - ) + var err error request := remoting.NewRequest("2.0.2") invocation := invocation.NewRPCInvocation("GetUser5", []interface{}{map[interface{}]interface{}{"id": "1", "name": "username"}}, nil) attachment := map[string]string{INTERFACE_KEY: "com.ikurento.user.UserProvider"} @@ -341,7 +330,6 @@ func testClient_AsyncCall(t *testing.T, svr *Server, url *common.URL, client *Cl } func InitTest(t *testing.T) (*Server, *common.URL) { - hessian.RegisterPOJO(&User{}) remoting.RegistryCodec("dubbo", &DubboTestCodec{}) @@ -388,7 +376,8 @@ func InitTest(t *testing.T) (*Server, *common.URL) { WaitTimeout: "1s", MaxMsgLen: 10240000000, SessionName: "server", - }}) + }, + }) assert.NoError(t, srvConf.CheckValidity()) url, err := common.NewURL("dubbo://127.0.0.1:20060/com.ikurento.user.UserProvider?anyhost=true&" + @@ -405,7 +394,7 @@ func InitTest(t *testing.T) (*Server, *common.URL) { BaseInvoker: *protocol.NewBaseInvoker(url), } handler := func(invocation *invocation.RPCInvocation) protocol.RPCResult { - //result := protocol.RPCResult{} + // result := protocol.RPCResult{} r := invoker.Invoke(context.Background(), invocation) result := protocol.RPCResult{ Err: r.Error(), @@ -432,8 +421,7 @@ type ( Name string `json:"name"` } - UserProvider struct { - //user map[string]User + UserProvider struct { // user map[string]User } ) @@ -473,7 +461,6 @@ func (u *UserProvider) GetUser3(rsp *[]interface{}) error { } func (u *UserProvider) GetUser4(ctx context.Context, req []interface{}) ([]interface{}, error) { - return []interface{}{User{Id: req[0].([]interface{})[0].(string), Name: req[0].([]interface{})[1].(string)}}, nil } diff --git a/remoting/getty/getty_server.go b/remoting/getty/getty_server.go index 4930a6ad0e..76eb4781cb 100644 --- a/remoting/getty/getty_server.go +++ b/remoting/getty/getty_server.go @@ -40,9 +40,7 @@ import ( "github.com/apache/dubbo-go/remoting" ) -var ( - srvConf *ServerConfig -) +var srvConf *ServerConfig func initServer(protocol string) { // load clientconfig from provider_config @@ -104,7 +102,7 @@ type Server struct { // NewServer create a new Server func NewServer(url *common.URL, handlers func(*invocation.RPCInvocation) protocol.RPCResult) *Server { - //init + // init initServer(url.Protocol) srvConf.SSLEnabled = url.GetParamBool(constant.SSL_ENABLED_KEY, false) diff --git a/remoting/getty/listener.go b/remoting/getty/listener.go index 5443d37102..96df02b37d 100644 --- a/remoting/getty/listener.go +++ b/remoting/getty/listener.go @@ -289,7 +289,6 @@ func (h *RpcServerHandler) OnMessage(session getty.Session, pkg interface{}) { } reply(session, resp) } - }() invoc, ok := req.Data.(*invocation.RPCInvocation) diff --git a/remoting/getty/opentracing.go b/remoting/getty/opentracing.go index 4ba4fde9d8..ab74c855d1 100644 --- a/remoting/getty/opentracing.go +++ b/remoting/getty/opentracing.go @@ -20,6 +20,7 @@ package getty import ( "github.com/opentracing/opentracing-go" ) + import ( invocation_impl "github.com/apache/dubbo-go/protocol/invocation" ) @@ -36,7 +37,7 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca } func filterContext(attachments map[string]interface{}) map[string]string { - var traceAttchment = make(map[string]string) + traceAttchment := make(map[string]string) for k, v := range attachments { if r, ok := v.(string); ok { traceAttchment[k] = r diff --git a/remoting/getty/pool.go b/remoting/getty/pool.go index 2b1cdfe2f4..7e8cb1377d 100644 --- a/remoting/getty/pool.go +++ b/remoting/getty/pool.go @@ -39,7 +39,7 @@ import ( type gettyRPCClient struct { once sync.Once - //protocol string + // protocol string addr string active int64 // zero, not create or be destroyed @@ -50,9 +50,7 @@ type gettyRPCClient struct { sessions []*rpcSession } -var ( - errClientPoolClosed = perrors.New("client pool closed") -) +var errClientPoolClosed = perrors.New("client pool closed") func newGettyRPCClientConn(pool *gettyRPCClientPool, addr string) (*gettyRPCClient, error) { var ( @@ -384,7 +382,7 @@ func (p *gettyRPCClientPool) get() (*gettyRPCClient, error) { conn = p.conns[0] } // This will recreate gettyRpcClient for remove last position - //p.conns = p.conns[:len(p.conns)-1] + // p.conns = p.conns[:len(p.conns)-1] if d := now - conn.getActive(); d > p.ttl { p.remove(conn) @@ -392,7 +390,7 @@ func (p *gettyRPCClientPool) get() (*gettyRPCClient, error) { num = len(p.conns) continue } - conn.updateActive(now) //update active time + conn.updateActive(now) // update active time return conn, nil } return nil, nil diff --git a/remoting/getty/readwriter.go b/remoting/getty/readwriter.go index 61062dfe50..c04437a8f2 100644 --- a/remoting/getty/readwriter.go +++ b/remoting/getty/readwriter.go @@ -51,7 +51,7 @@ func NewRpcClientPackageHandler(client *Client) *RpcClientPackageHandler { // and send to client each time. the Read can assemble it. func (p *RpcClientPackageHandler) Read(ss getty.Session, data []byte) (interface{}, int, error) { resp, length, err := (p.client.codec).Decode(data) - //err := pkg.Unmarshal(buf, p.client) + // err := pkg.Unmarshal(buf, p.client) if err != nil { if errors.Is(err, hessian.ErrHeaderNotEnough) || errors.Is(err, hessian.ErrBodyNotEnough) { return nil, 0, nil @@ -112,7 +112,7 @@ func NewRpcServerPackageHandler(server *Server) *RpcServerPackageHandler { // and send to client each time. the Read can assemble it. func (p *RpcServerPackageHandler) Read(ss getty.Session, data []byte) (interface{}, int, error) { req, length, err := (p.server.codec).Decode(data) - //resp,len, err := (*p.).DecodeResponse(buf) + // resp,len, err := (*p.).DecodeResponse(buf) if err != nil { if errors.Is(err, hessian.ErrHeaderNotEnough) || errors.Is(err, hessian.ErrBodyNotEnough) { return nil, 0, nil @@ -150,5 +150,4 @@ func (p *RpcServerPackageHandler) Write(ss getty.Session, pkg interface{}) ([]by logger.Errorf("illegal pkg:%+v\n, it is %+v", pkg, reflect.TypeOf(pkg)) return nil, perrors.New("invalid rpc response") - } diff --git a/remoting/getty/readwriter_test.go b/remoting/getty/readwriter_test.go index c54c385b0e..db6dd8e9f2 100644 --- a/remoting/getty/readwriter_test.go +++ b/remoting/getty/readwriter_test.go @@ -125,7 +125,8 @@ func getServer(t *testing.T) (*Server, *common.URL) { WaitTimeout: "1s", MaxMsgLen: 10240000000, SessionName: "server", - }}) + }, + }) assert.NoError(t, srvConf.CheckValidity()) url, err := common.NewURL("dubbo://127.0.0.1:20061/com.ikurento.user.AdminProvider?anyhost=true&" + @@ -142,7 +143,7 @@ func getServer(t *testing.T) (*Server, *common.URL) { BaseInvoker: *protocol.NewBaseInvoker(url), } handler := func(invocation *invocation.RPCInvocation) protocol.RPCResult { - //result := protocol.RPCResult{} + // result := protocol.RPCResult{} r := invoker.Invoke(context.Background(), invocation) result := protocol.RPCResult{ Err: r.Error(), @@ -159,8 +160,7 @@ func getServer(t *testing.T) (*Server, *common.URL) { return server, url } -type AdminProvider struct { -} +type AdminProvider struct{} func (a *AdminProvider) GetAdmin(ctx context.Context, req []interface{}, rsp *User) error { rsp.Id = req[0].(string) diff --git a/remoting/kubernetes/client.go b/remoting/kubernetes/client.go index ce6bcccea5..aabbc00579 100644 --- a/remoting/kubernetes/client.go +++ b/remoting/kubernetes/client.go @@ -76,7 +76,6 @@ func newClient(url *common.URL) (*Client, error) { // Create creates k/v pair in watcher-set func (c *Client) Create(k, v string) error { - // the read current pod must be lock, protect every // create operation can be atomic c.lock.Lock() @@ -92,7 +91,6 @@ func (c *Client) Create(k, v string) error { // GetChildren gets k children list from kubernetes-watcherSet func (c *Client) GetChildren(k string) ([]string, []string, error) { - objectList, err := c.controller.watcherSet.Get(k, true) if err != nil { return nil, nil, perrors.WithMessagef(err, "get children from watcherSet on (%s)", k) @@ -111,7 +109,6 @@ func (c *Client) GetChildren(k string) ([]string, []string, error) { // Watch watches on spec key func (c *Client) Watch(k string) (<-chan *WatcherEvent, <-chan struct{}, error) { - w, err := c.controller.watcherSet.Watch(k, false) if err != nil { return nil, nil, perrors.WithMessagef(err, "watch on (%s)", k) @@ -122,7 +119,6 @@ func (c *Client) Watch(k string) (<-chan *WatcherEvent, <-chan struct{}, error) // WatchWithPrefix watches on spec prefix func (c *Client) WatchWithPrefix(prefix string) (<-chan *WatcherEvent, <-chan struct{}, error) { - w, err := c.controller.watcherSet.Watch(prefix, true) if err != nil { return nil, nil, perrors.WithMessagef(err, "watch on prefix (%s)", prefix) @@ -133,7 +129,6 @@ func (c *Client) WatchWithPrefix(prefix string) (<-chan *WatcherEvent, <-chan st // if returns false, the client is die func (c *Client) Valid() bool { - select { case <-c.Done(): return false @@ -151,10 +146,9 @@ func (c *Client) Done() <-chan struct{} { // nolint func (c *Client) Close() { - select { case <-c.ctx.Done(): - //already stopped + // already stopped return default: } @@ -167,7 +161,6 @@ func (c *Client) Close() { // ValidateClient validates the kubernetes client func ValidateClient(container clientFacade) error { - client := container.Client() // new Client diff --git a/remoting/kubernetes/client_test.go b/remoting/kubernetes/client_test.go index 9cc421225e..be7256167d 100644 --- a/remoting/kubernetes/client_test.go +++ b/remoting/kubernetes/client_test.go @@ -59,9 +59,8 @@ var tests = []struct { // test dataset prefix const prefix = "name" -var ( - watcherStopLog = "the watcherSet watcher was stopped" -) +var watcherStopLog = "the watcherSet watcher was stopped" + var clientPodListJsonData = `{ "apiVersion": "v1", "items": [ @@ -228,7 +227,6 @@ var clientPodListJsonData = `{ ` func getTestClient(t *testing.T) *Client { - pl := &v1.PodList{} // 1. install test data if err := json.Unmarshal([]byte(clientPodListJsonData), &pl); err != nil { @@ -257,7 +255,6 @@ func getTestClient(t *testing.T) *Client { } func TestClientValid(t *testing.T) { - client := getTestClient(t) defer client.Close() @@ -272,7 +269,6 @@ func TestClientValid(t *testing.T) { } func TestClientDone(t *testing.T) { - client := getTestClient(t) go func() { @@ -287,7 +283,6 @@ func TestClientDone(t *testing.T) { } func TestClientCreateKV(t *testing.T) { - client := getTestClient(t) defer client.Close() @@ -304,7 +299,6 @@ func TestClientCreateKV(t *testing.T) { } func TestClientGetChildrenKVList(t *testing.T) { - client := getTestClient(t) defer client.Close() @@ -314,7 +308,6 @@ func TestClientGetChildrenKVList(t *testing.T) { syncDataComplete := make(chan struct{}) go func() { - wc, done, err := client.WatchWithPrefix(prefix) if err != nil { t.Error(err) @@ -374,23 +367,19 @@ func TestClientGetChildrenKVList(t *testing.T) { } for expectK, expectV := range expect { - if got[expectK] != expectV { t.Fatalf("expect {%s: %s} but got {%s: %v}", expectK, expectV, expectK, got[expectK]) } } - } func TestClientWatchPrefix(t *testing.T) { - client := getTestClient(t) wg := sync.WaitGroup{} wg.Add(1) go func() { - wc, done, err := client.WatchWithPrefix(prefix) if err != nil { t.Error(err) @@ -426,14 +415,12 @@ func TestClientWatchPrefix(t *testing.T) { } func TestClientWatch(t *testing.T) { - client := getTestClient(t) wg := sync.WaitGroup{} wg.Add(1) go func() { - wc, done, err := client.Watch(prefix) if err != nil { t.Error(err) @@ -449,7 +436,6 @@ func TestClientWatch(t *testing.T) { return } } - }() // must wait the watch goroutine already start the watch goroutine diff --git a/remoting/kubernetes/facade_test.go b/remoting/kubernetes/facade_test.go index a6c6c02b51..d0d710cb26 100644 --- a/remoting/kubernetes/facade_test.go +++ b/remoting/kubernetes/facade_test.go @@ -30,8 +30,8 @@ import ( type mockFacade struct { *common.URL client *Client - //cltLock sync.Mutex - //done chan struct{} + // cltLock sync.Mutex + // done chan struct{} } func (r *mockFacade) Client() *Client { @@ -57,8 +57,8 @@ func (r *mockFacade) RestartCallBack() bool { func (r *mockFacade) IsAvailable() bool { return true } -func Test_Facade(t *testing.T) { +func Test_Facade(t *testing.T) { regUrl, err := common.NewURL("registry://127.0.0.1:443", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.CONSUMER))) if err != nil { diff --git a/remoting/kubernetes/listener.go b/remoting/kubernetes/listener.go index a737f4e0d4..2c4149b850 100644 --- a/remoting/kubernetes/listener.go +++ b/remoting/kubernetes/listener.go @@ -86,7 +86,6 @@ func (l *EventListener) ListenServiceNodeEvent(key string, listener ...remoting. // return true means the event type is DELETE // return false means the event type is CREATE || UPDATE func (l *EventListener) handleEvents(event *WatcherEvent, listeners ...remoting.DataListener) bool { - logger.Infof("got a kubernetes-watcherSet event {type: %d, key: %s}", event.EventType, event.Key) switch event.EventType { @@ -120,7 +119,6 @@ func (l *EventListener) handleEvents(event *WatcherEvent, listeners ...remoting. // Listen on a set of key with spec prefix func (l *EventListener) ListenServiceNodeEventWithPrefix(prefix string, listener ...remoting.DataListener) { - defer l.wg.Done() for { wc, done, err := l.client.WatchWithPrefix(prefix) @@ -157,7 +155,6 @@ func (l *EventListener) ListenServiceNodeEventWithPrefix(prefix string, listener // | // --------> ListenServiceNodeEvent func (l *EventListener) ListenServiceEvent(key string, listener remoting.DataListener) { - l.keyMapLock.RLock() _, ok := l.keyMap[key] l.keyMapLock.RUnlock() diff --git a/remoting/kubernetes/listener_test.go b/remoting/kubernetes/listener_test.go index 0b05b6e6e0..4701b5d343 100644 --- a/remoting/kubernetes/listener_test.go +++ b/remoting/kubernetes/listener_test.go @@ -69,8 +69,7 @@ func (m *mockDataListener) DataChange(eventType remoting.Event) bool { } func TestListener(t *testing.T) { - - var tests = []struct { + tests := []struct { input struct { k string v string diff --git a/remoting/kubernetes/registry_controller.go b/remoting/kubernetes/registry_controller.go index f66163d3c6..212549a3ee 100644 --- a/remoting/kubernetes/registry_controller.go +++ b/remoting/kubernetes/registry_controller.go @@ -68,9 +68,7 @@ const ( defaultResync = 5 * time.Minute ) -var ( - ErrDubboLabelAlreadyExist = perrors.New("dubbo label already exist") -) +var ErrDubboLabelAlreadyExist = perrors.New("dubbo label already exist") // dubboRegistryController works like a kubernetes controller type dubboRegistryController struct { @@ -96,7 +94,7 @@ type dubboRegistryController struct { listAndWatchStartResourceVersion uint64 namespacedInformerFactory map[string]informers.SharedInformerFactory namespacedPodInformers map[string]informerscorev1.PodInformer - queue workqueue.Interface //shared by namespaced informers + queue workqueue.Interface // shared by namespaced informers } func newDubboRegistryController( @@ -146,7 +144,6 @@ func newDubboRegistryController( // GetInClusterKubernetesClient // current pod running in kubernetes-cluster func GetInClusterKubernetesClient() (kubernetes.Interface, error) { - // read in-cluster config cfg, err := rest.InClusterConfig() if err != nil { @@ -161,7 +158,6 @@ func GetInClusterKubernetesClient() (kubernetes.Interface, error) { // 2. put every element to watcherSet // 3. refresh watch book-mark func (c *dubboRegistryController) initWatchSet() error { - req, err := labels.NewRequirement(DubboIOLabelKey, selection.In, []string{DubboIOConsumerLabelValue, DubboIOProviderLabelValue}) if err != nil { return perrors.WithMessage(err, "new requirement") @@ -193,7 +189,6 @@ func (c *dubboRegistryController) initWatchSet() error { // 1. current pod name // 2. current pod working namespace func (c *dubboRegistryController) readConfig() error { - // read current pod name && namespace c.name = os.Getenv(podNameKey) if len(c.name) == 0 { @@ -207,7 +202,6 @@ func (c *dubboRegistryController) readConfig() error { } func (c *dubboRegistryController) initNamespacedPodInformer(ns string) error { - req, err := labels.NewRequirement(DubboIOLabelKey, selection.In, []string{DubboIOConsumerLabelValue, DubboIOProviderLabelValue}) if err != nil { return perrors.WithMessage(err, "new requirement") @@ -237,7 +231,6 @@ func (c *dubboRegistryController) initNamespacedPodInformer(ns string) error { } func (c *dubboRegistryController) initPodInformer() error { - if c.role == common.PROVIDER { return nil } @@ -323,7 +316,6 @@ func (c *dubboRegistryController) startALLInformers() { // run // controller process every event in work-queue func (c *dubboRegistryController) run() { - if c.role == common.PROVIDER { return } @@ -402,7 +394,6 @@ func (c *dubboRegistryController) handleWatchedPodEvent(p *v1.Pod, eventType wat // unmarshalRecord unmarshals the kubernetes dubbo annotation value func (c *dubboRegistryController) unmarshalRecord(record string) ([]*WatcherEvent, error) { - if len(record) == 0 { // []*WatcherEvent is nil. return nil, nil @@ -497,7 +488,6 @@ func (c *dubboRegistryController) assembleDUBBOLabel(p *v1.Pod) (*v1.Pod, *v1.Po // assembleDUBBOAnnotations assembles the dubbo kubernetes annotations // accord the current pod && (k,v) assemble the old-pod, new-pod func (c *dubboRegistryController) assembleDUBBOAnnotations(k, v string, currentPod *v1.Pod) (oldPod *v1.Pod, newPod *v1.Pod, err error) { - oldPod = &v1.Pod{} newPod = &v1.Pod{} oldPod.Annotations = make(map[string]string, 8) @@ -563,7 +553,6 @@ func (c *dubboRegistryController) readCurrentPod() (*v1.Pod, error) { // addAnnotationForCurrentPod adds annotation for current pod func (c *dubboRegistryController) addAnnotationForCurrentPod(k string, v string) error { - c.lock.Lock() defer c.lock.Unlock() diff --git a/remoting/kubernetes/watch.go b/remoting/kubernetes/watch.go index 7bb5ef1754..34f5a3458a 100644 --- a/remoting/kubernetes/watch.go +++ b/remoting/kubernetes/watch.go @@ -46,7 +46,6 @@ const ( ) func (e eventType) String() string { - switch e { case Create: return "CREATE" @@ -143,9 +142,7 @@ func (s *watcherSetImpl) Done() <-chan struct{} { // Put puts the watch event to watcher-set func (s *watcherSetImpl) Put(watcherEvent *WatcherEvent) error { - blockSendMsg := func(object *WatcherEvent, w *watcher) { - select { case <-w.done(): // the watcher already stop @@ -212,7 +209,6 @@ func (s *watcherSetImpl) valid() error { // addWatcher func (s *watcherSetImpl) addWatcher(key string, prefix bool) (Watcher, error) { - if err := s.valid(); err != nil { return nil, err } @@ -239,7 +235,6 @@ func (s *watcherSetImpl) addWatcher(key string, prefix bool) (Watcher, error) { // Get gets elements from watcher-set func (s *watcherSetImpl) Get(key string, prefix bool) ([]*WatcherEvent, error) { - s.lock.RLock() defer s.lock.RUnlock() @@ -302,7 +297,6 @@ func (w *watcher) ID() string { // nolint func (w *watcher) stop() { - // double close will panic w.closeOnce.Do(func() { close(w.exit) diff --git a/remoting/kubernetes/watch_test.go b/remoting/kubernetes/watch_test.go index efefcc5dc9..9a0139dd68 100644 --- a/remoting/kubernetes/watch_test.go +++ b/remoting/kubernetes/watch_test.go @@ -26,7 +26,6 @@ import ( ) func TestWatchSet(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() @@ -61,7 +60,6 @@ func TestWatchSet(t *testing.T) { wg.Add(1) go func() { - defer wg.Done() w, err := s.Watch("key", true) if err != nil { diff --git a/remoting/listener.go b/remoting/listener.go index eb27c71dfd..a87e502446 100644 --- a/remoting/listener.go +++ b/remoting/listener.go @@ -23,7 +23,7 @@ import ( // DataListener defines common data listener interface type DataListener interface { - DataChange(eventType Event) bool //bool is return for interface implement is interesting + DataChange(eventType Event) bool // bool is return for interface implement is interesting } ////////////////////////////////////////// diff --git a/remoting/zookeeper/curator_discovery/service_discovery.go b/remoting/zookeeper/curator_discovery/service_discovery.go index ebe784c353..9c7488bc2a 100644 --- a/remoting/zookeeper/curator_discovery/service_discovery.go +++ b/remoting/zookeeper/curator_discovery/service_discovery.go @@ -120,7 +120,6 @@ func (sd *ServiceDiscovery) UpdateService(instance *ServiceInstance) error { return perrors.New("[ServiceDiscovery] services value not entry") } data, err := json.Marshal(instance) - if err != nil { return err } diff --git a/remoting/zookeeper/facade.go b/remoting/zookeeper/facade.go index aeaa317ea3..3bc7995561 100644 --- a/remoting/zookeeper/facade.go +++ b/remoting/zookeeper/facade.go @@ -21,9 +21,11 @@ import ( "sync" "time" ) + import ( gxzookeeper "github.com/dubbogo/gost/database/kv/zk" ) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/logger" diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index c24a4fc1f9..5440127a88 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -38,9 +38,7 @@ import ( "github.com/apache/dubbo-go/remoting" ) -var ( - defaultTTL = 15 * time.Minute -) +var defaultTTL = 15 * time.Minute // nolint type ZkEventListener struct { diff --git a/remoting/zookeeper/listener_test.go b/remoting/zookeeper/listener_test.go index 12786655a7..67abd23214 100644 --- a/remoting/zookeeper/listener_test.go +++ b/remoting/zookeeper/listener_test.go @@ -35,9 +35,7 @@ import ( "github.com/apache/dubbo-go/remoting" ) -var ( - dubboPropertiesPath = "/dubbo/dubbo.properties" -) +var dubboPropertiesPath = "/dubbo/dubbo.properties" func initZkData(t *testing.T) (*zk.TestCluster, *gxzookeeper.ZookeeperClient, <-chan zk.Event) { ts, client, event, err := gxzookeeper.NewMockZookeeperClient("test", 15*time.Second) diff --git a/test/integrate/dubbo/go-client/client.go b/test/integrate/dubbo/go-client/client.go index 4c62674d33..afe965ed25 100644 --- a/test/integrate/dubbo/go-client/client.go +++ b/test/integrate/dubbo/go-client/client.go @@ -37,9 +37,7 @@ import ( _ "github.com/apache/dubbo-go/registry/zookeeper" ) -var ( - survivalTimeout int = 10e9 -) +var survivalTimeout int = 10e9 func println(format string, args ...interface{}) { fmt.Printf("\033[32;40m"+format+"\033[0m\n", args...) diff --git a/test/integrate/dubbo/go-client/go.sum b/test/integrate/dubbo/go-client/go.sum index a75f33748c..168ccc1985 100644 --- a/test/integrate/dubbo/go-client/go.sum +++ b/test/integrate/dubbo/go-client/go.sum @@ -524,6 +524,7 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= diff --git a/test/integrate/dubbo/go-client/version.go b/test/integrate/dubbo/go-client/version.go index c6138584f1..92974643b3 100644 --- a/test/integrate/dubbo/go-client/version.go +++ b/test/integrate/dubbo/go-client/version.go @@ -17,6 +17,4 @@ package main -var ( - Version = "2.6.0" -) +var Version = "2.6.0" diff --git a/test/integrate/dubbo/go-server/go.sum b/test/integrate/dubbo/go-server/go.sum index a75f33748c..168ccc1985 100644 --- a/test/integrate/dubbo/go-server/go.sum +++ b/test/integrate/dubbo/go-server/go.sum @@ -524,6 +524,7 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= diff --git a/test/integrate/dubbo/go-server/server.go b/test/integrate/dubbo/go-server/server.go index a5d18dba3c..0a38819085 100644 --- a/test/integrate/dubbo/go-server/server.go +++ b/test/integrate/dubbo/go-server/server.go @@ -33,15 +33,12 @@ import ( _ "github.com/apache/dubbo-go/registry/zookeeper" ) -var ( - stopC = make(chan struct{}) -) +var stopC = make(chan struct{}) // they are necessary: // export CONF_PROVIDER_FILE_PATH="xxx" // export APP_LOG_CONF_FILE="xxx" func main() { - hessian.RegisterPOJO(&User{}) config.Load() diff --git a/test/integrate/dubbo/go-server/user.go b/test/integrate/dubbo/go-server/user.go index 7bff415661..aace76c1d2 100644 --- a/test/integrate/dubbo/go-server/user.go +++ b/test/integrate/dubbo/go-server/user.go @@ -41,8 +41,7 @@ type User struct { Time time.Time } -type UserProvider struct { -} +type UserProvider struct{} func (u *UserProvider) GetUser(ctx context.Context, req []interface{}) (*User, error) { println("req:%#v", req) diff --git a/test/integrate/dubbo/go-server/version.go b/test/integrate/dubbo/go-server/version.go index c6138584f1..92974643b3 100644 --- a/test/integrate/dubbo/go-server/version.go +++ b/test/integrate/dubbo/go-server/version.go @@ -17,6 +17,4 @@ package main -var ( - Version = "2.6.0" -) +var Version = "2.6.0" diff --git a/tools/cli/client/client.go b/tools/cli/client/client.go index fd15939bba..b6ab019cb1 100644 --- a/tools/cli/client/client.go +++ b/tools/cli/client/client.go @@ -68,7 +68,7 @@ func NewTelnetClient(host string, port int, protocolName, interfaceID, version, return &TelnetClient{ tcpAddr: tcpAddr, conn: conn, - responseTimeout: time.Duration(timeout) * time.Millisecond, //default timeout + responseTimeout: time.Duration(timeout) * time.Millisecond, // default timeout protocolName: protocolName, pendingResponses: &sync.Map{}, proto: proto, @@ -95,7 +95,7 @@ func resolveTCPAddr(addr string) *net.TCPAddr { // ProcessRequests send all requests func (t *TelnetClient) ProcessRequests(userPkg interface{}) { - for i, _ := range t.requestList { + for i := range t.requestList { t.processSingleRequest(t.requestList[i], userPkg) } } diff --git a/tools/cli/common/protocol.go b/tools/cli/common/protocol.go index dd2454a1c7..d54d553e0a 100644 --- a/tools/cli/common/protocol.go +++ b/tools/cli/common/protocol.go @@ -21,9 +21,7 @@ import ( "github.com/apache/dubbo-go/tools/cli/protocol" ) -var ( - protocols = make(map[string]func() protocol.Protocol, 8) -) +var protocols = make(map[string]func() protocol.Protocol, 8) // SetProtocol sets the protocol extension with @name func SetProtocol(name string, v func() protocol.Protocol) { diff --git a/tools/cli/example/server/main.go b/tools/cli/example/server/main.go index ed1ed5290e..00ea543f45 100644 --- a/tools/cli/example/server/main.go +++ b/tools/cli/example/server/main.go @@ -38,9 +38,7 @@ import ( _ "github.com/apache/dubbo-go/registry/protocol" ) -var ( - survivalTimeout = int(3e9) -) +var survivalTimeout = int(3e9) // they are necessary: // export CONF_PROVIDER_FILE_PATH="xxx" diff --git a/tools/cli/example/server/user.go b/tools/cli/example/server/user.go index 5835848dc9..0bb25b545b 100644 --- a/tools/cli/example/server/user.go +++ b/tools/cli/example/server/user.go @@ -34,8 +34,7 @@ func init() { hessian.RegisterPOJO(&CallUserStruct{}) } -type UserProvider struct { -} +type UserProvider struct{} func (u *UserProvider) GetUser(ctx context.Context, userStruct *CallUserStruct) (*User, error) { fmt.Printf("=======================\nreq:%#v\n", userStruct) diff --git a/tools/cli/main.go b/tools/cli/main.go index 1f90f67293..43ed3741b0 100644 --- a/tools/cli/main.go +++ b/tools/cli/main.go @@ -27,16 +27,18 @@ import ( "github.com/apache/dubbo-go/tools/cli/json_register" ) -var host string -var port int -var protocolName string -var InterfaceID string -var version string -var group string -var method string -var sendObjFilePath string -var recvObjFilePath string -var timeout int +var ( + host string + port int + protocolName string + InterfaceID string + version string + group string + method string + sendObjFilePath string + recvObjFilePath string + timeout int +) func init() { flag.StringVar(&host, "h", "localhost", "target server host") diff --git a/tools/cli/protocol/dubbo/codec.go b/tools/cli/protocol/dubbo/codec.go index f73bf8e5c0..ba5e6b4ccb 100644 --- a/tools/cli/protocol/dubbo/codec.go +++ b/tools/cli/protocol/dubbo/codec.go @@ -33,7 +33,7 @@ import ( hessian "github.com/apache/dubbo-go-hessian2" ) -//SerialID serial ID +// SerialID serial ID type SerialID byte const ( @@ -41,7 +41,7 @@ const ( S_Dubbo SerialID = 2 ) -//CallType call type +// CallType call type type CallType int32 const ( diff --git a/tools/cli/protocol/dubbo/dubbo_protocol.go b/tools/cli/protocol/dubbo/dubbo_protocol.go index 97a3ac7ea5..f16f838061 100644 --- a/tools/cli/protocol/dubbo/dubbo_protocol.go +++ b/tools/cli/protocol/dubbo/dubbo_protocol.go @@ -39,8 +39,7 @@ func init() { } // RpcClientPackageHandler handle package for client in getty. -type RpcClientPackageHandler struct { -} +type RpcClientPackageHandler struct{} func NewRpcClientPackageHandler() protocol.Protocol { return RpcClientPackageHandler{}