Skip to content

Commit

Permalink
delete unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
cjphaha committed Jan 1, 2021
1 parent 1c4a4ef commit 50854c3
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 183 deletions.
1 change: 0 additions & 1 deletion cluster/router/tag/tag_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const (

var (
zkFormat = "zookeeper://%s:%d"
conditionFormat = "condition://%s/com.foo.BarService"
)

// MockInvoker is only mock the Invoker to support test tagRouter
Expand Down
4 changes: 0 additions & 4 deletions config_center/nacos/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package nacos

import (
"path/filepath"
"strconv"
"strings"
"sync"
Expand All @@ -38,9 +37,6 @@ import (
"github.com/apache/dubbo-go/common/logger"
)

// Nacos Log dir, it can be override when creating client by config_center.log_dir
var logDir = filepath.Join("logs", "nacos", "log")

// NacosClient Nacos client
type NacosClient struct {
name string
Expand Down
9 changes: 0 additions & 9 deletions protocol/dubbo/hessian2/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import (
perrors "github.com/pkg/errors"
)

const (
mask = byte(127)
flag = byte(128)
)

const (
// Zero : byte zero
Zero = byte(0x00)
Expand Down Expand Up @@ -84,10 +79,6 @@ const (
BC_LIST_FIXED = byte('V')
BC_LIST_VARIABLE_UNTYPED = byte(0x57)
BC_LIST_FIXED_UNTYPED = byte(0x58)
_listFixedTypedLenTagMin = byte(0x70)
_listFixedTypedLenTagMax = byte(0x77)
_listFixedUntypedLenTagMin = byte(0x78)
_listFixedUntypedLenTagMax = byte(0x7f)

BC_LIST_DIRECT = byte(0x70)
BC_LIST_DIRECT_UNTYPED = byte(0x78)
Expand Down
9 changes: 0 additions & 9 deletions protocol/dubbo/impl/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ const (
DUBBO = "dubbo"
)

const (
mask = byte(127)
flag = byte(128)
)

const (
// Zero : byte zero
Zero = byte(0x00)
Expand Down Expand Up @@ -84,10 +79,6 @@ const (
BC_LIST_FIXED = byte('V')
BC_LIST_VARIABLE_UNTYPED = byte(0x57)
BC_LIST_FIXED_UNTYPED = byte(0x58)
_listFixedTypedLenTagMin = byte(0x70)
_listFixedTypedLenTagMax = byte(0x77)
_listFixedUntypedLenTagMin = byte(0x78)
_listFixedUntypedLenTagMax = byte(0x7f)

BC_LIST_DIRECT = byte(0x70)
BC_LIST_DIRECT_UNTYPED = byte(0x78)
Expand Down
8 changes: 0 additions & 8 deletions protocol/dubbo/opentracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca
return err
}

func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) {
traceAttachments := filterContext(inv.Attachments())
// actually, if user do not use any opentracing framework, the err will not be nil.
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap,
opentracing.TextMapCarrier(traceAttachments))
return spanCtx, err
}

func filterContext(attachments map[string]interface{}) map[string]string {
var traceAttchment = make(map[string]string)
for k, v := range attachments {
Expand Down
8 changes: 0 additions & 8 deletions protocol/grpc/protoc-gen-dubbo/plugin/dubbo/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,11 @@ import (
"github.com/golang/protobuf/protoc-gen-go/generator"
)

// generatedCodeVersion indicates a version of the generated code.
// It is incremented whenever an incompatibility between the generated code and
// the grpc package is introduced; the generated code references
// a constant, grpc.SupportPackageIsVersionN (where N is generatedCodeVersion).
const generatedCodeVersion = 4

// Paths for packages used by code generated in this file,
// relative to the import_prefix of the generator.Generator.
const (
contextPkgPath = "context"
grpcPkgPath = "google.golang.org/grpc"
codePkgPath = "google.golang.org/grpc/codes"
statusPkgPath = "google.golang.org/grpc/status"
)

func init() {
Expand Down
2 changes: 0 additions & 2 deletions protocol/jsonrpc/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ const (
CodeMethodNotFound = -32601
CodeInvalidParams = -32602
CodeInternalError = -32603
codeServerErrorStart = -32099
codeServerErrorEnd = -32000
)

// Error response Error
Expand Down
132 changes: 0 additions & 132 deletions registry/kubernetes/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,138 +31,6 @@ import (
"github.com/apache/dubbo-go/remoting"
)

var clientPodJsonData = `{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"annotations": {
"dubbo.io/annotation": "W3siayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJibyIsInYiOiIifSx7ImsiOiIvZHViYm8vY29tLmlrdXJlbnRvLnVzZXIuVXNlclByb3ZpZGVyIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvcHJvdmlkZXJzIiwidiI6IiJ9LHsiayI6Ii9kdWJiby9jb20uaWt1cmVudG8udXNlci5Vc2VyUHJvdmlkZXIvY29uc3VtZXJzL2NvbnN1bWVyJTNBJTJGJTJGMTcyLjE3LjAuOCUyRlVzZXJQcm92aWRlciUzRmNhdGVnb3J5JTNEY29uc3VtZXJzJTI2ZHViYm8lM0RkdWJib2dvLWNvbnN1bWVyLTIuNi4wJTI2cHJvdG9jb2wlM0RkdWJibyIsInYiOiIifV0="
},
"creationTimestamp": "2020-03-13T03:38:57Z",
"labels": {
"dubbo.io/label": "dubbo.io-value"
},
"name": "client",
"namespace": "default",
"resourceVersion": "2449700",
"selfLink": "/api/v1/namespaces/default/pods/client",
"uid": "3ec394f5-dcc6-49c3-8061-57b4b2b41344"
},
"spec": {
"containers": [
{
"env": [
{
"name": "NAMESPACE",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
}
],
"image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client",
"imagePullPolicy": "Always",
"name": "client",
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"name": "dubbo-sa-token-l2lzh",
"readOnly": true
}
]
}
],
"dnsPolicy": "ClusterFirst",
"enableServiceLinks": true,
"nodeName": "minikube",
"priority": 0,
"restartPolicy": "Never",
"schedulerName": "default-scheduler",
"securityContext": {},
"serviceAccount": "dubbo-sa",
"serviceAccountName": "dubbo-sa",
"terminationGracePeriodSeconds": 30,
"tolerations": [
{
"effect": "NoExecute",
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"tolerationSeconds": 300
},
{
"effect": "NoExecute",
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"tolerationSeconds": 300
}
],
"volumes": [
{
"name": "dubbo-sa-token-l2lzh",
"secret": {
"defaultMode": 420,
"secretName": "dubbo-sa-token-l2lzh"
}
}
]
},
"status": {
"conditions": [
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:38:57Z",
"status": "True",
"type": "Initialized"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:40:18Z",
"status": "True",
"type": "Ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:40:18Z",
"status": "True",
"type": "ContainersReady"
},
{
"lastProbeTime": null,
"lastTransitionTime": "2020-03-13T03:38:57Z",
"status": "True",
"type": "PodScheduled"
}
],
"containerStatuses": [
{
"containerID": "docker://2870d6abc19ca7fe22ca635ebcfac5d48c6d5550a659bafd74fb48104f6dfe3c",
"image": "registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client:latest",
"imageID": "docker-pullable://registry.cn-hangzhou.aliyuncs.com/scottwang/dubbogo-client@sha256:1f075131f708a0d400339e81549d7c4d4ed917ab0b6bd38ef458dd06ad25a559",
"lastState": {},
"name": "client",
"ready": true,
"restartCount": 0,
"state": {
"running": {
"startedAt": "2020-03-13T03:40:17Z"
}
}
}
],
"hostIP": "10.0.2.15",
"phase": "Running",
"podIP": "172.17.0.8",
"qosClass": "BestEffort",
"startTime": "2020-03-13T03:38:57Z"
}
}
`

func Test_DataChange(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")
Expand Down
2 changes: 0 additions & 2 deletions remoting/getty/getty_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import (
)

var (
errInvalidCodecType = perrors.New("illegal CodecType")
errInvalidAddress = perrors.New("remote address invalid or empty")
errSessionNotExist = perrors.New("session not exist")
errClientClosed = perrors.New("client closed")
errClientReadTimeout = perrors.New("client read timeout")
Expand Down
8 changes: 0 additions & 8 deletions remoting/getty/opentracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ func injectTraceCtx(currentSpan opentracing.Span, inv *invocation_impl.RPCInvoca
return err
}

func extractTraceCtx(inv *invocation_impl.RPCInvocation) (opentracing.SpanContext, error) {
traceAttachments := filterContext(inv.Attachments())
// actually, if user do not use any opentracing framework, the err will not be nil.
spanCtx, err := opentracing.GlobalTracer().Extract(opentracing.TextMap,
opentracing.TextMapCarrier(traceAttachments))
return spanCtx, err
}

func filterContext(attachments map[string]interface{}) map[string]string {
var traceAttchment = make(map[string]string)
for k, v := range attachments {
Expand Down

0 comments on commit 50854c3

Please sign in to comment.