From a1e9a4d65b22bb5a023c1401c6f3c57e7ba8141d Mon Sep 17 00:00:00 2001
From: pantianying <601666418@qq.com>
Date: Wed, 31 Jul 2019 14:47:15 +0800
Subject: [PATCH] fix fmt

---
 common/constant/key.go                         |  1 +
 config/generic_service_test.go                 | 17 -----------------
 config/reference_config.go                     |  6 +++---
 examples/general/dubbo/go-client/app/client.go |  2 +-
 filter/impl/generic_filter.go                  |  6 ++++--
 filter/impl/generic_filter_test.go             |  6 +++---
 6 files changed, 12 insertions(+), 26 deletions(-)
 delete mode 100644 config/generic_service_test.go

diff --git a/common/constant/key.go b/common/constant/key.go
index bca658b26..ba86c531c 100644
--- a/common/constant/key.go
+++ b/common/constant/key.go
@@ -30,6 +30,7 @@ const (
 	METHODS_KEY   = "methods"
 	TIMEOUT_KEY   = "timeout"
 	BEAN_NAME_KEY = "bean.name"
+	GENERIC_KEY   = "generic"
 )
 
 const (
diff --git a/config/generic_service_test.go b/config/generic_service_test.go
deleted file mode 100644
index 027edf85b..000000000
--- a/config/generic_service_test.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package config
diff --git a/config/reference_config.go b/config/reference_config.go
index 99d442ad4..4f2bdbbc2 100644
--- a/config/reference_config.go
+++ b/config/reference_config.go
@@ -55,7 +55,7 @@ type ReferenceConfig struct {
 	Params        map[string]string `yaml:"params"  json:"params,omitempty" property:"params"`
 	invoker       protocol.Invoker
 	urls          []*common.URL
-	Generic       bool
+	Generic       bool `yaml:"generic"  json:"generic,omitempty" property:"generic"`
 }
 
 func (c *ReferenceConfig) Prefix() string {
@@ -157,6 +157,7 @@ func (refconfig *ReferenceConfig) getUrlMap() url.Values {
 	urlMap.Set(constant.RETRIES_KEY, strconv.FormatInt(refconfig.Retries, 10))
 	urlMap.Set(constant.GROUP_KEY, refconfig.Group)
 	urlMap.Set(constant.VERSION_KEY, refconfig.Version)
+	urlMap.Set(constant.GENERIC_KEY, strconv.FormatBool(refconfig.Generic))
 	//getty invoke async or sync
 	urlMap.Set(constant.ASYNC_KEY, strconv.FormatBool(refconfig.async))
 
@@ -183,8 +184,7 @@ func (refconfig *ReferenceConfig) getUrlMap() url.Values {
 	return urlMap
 
 }
-func (refconfig *ReferenceConfig) Load(id string) {
-	//gr.Filter = "genericConsumer" //todo: add genericConsumer filter
+func (refconfig *ReferenceConfig) GenericLoad(id string) {
 	genericService := NewGenericService(refconfig.id)
 	SetConsumerService(genericService)
 	refconfig.id = id
diff --git a/examples/general/dubbo/go-client/app/client.go b/examples/general/dubbo/go-client/app/client.go
index 8fc7d992a..9b50ca0a3 100644
--- a/examples/general/dubbo/go-client/app/client.go
+++ b/examples/general/dubbo/go-client/app/client.go
@@ -297,7 +297,7 @@ func test3() {
 		Protocol:      dubbo.DUBBO,
 		Generic:       true,
 	}
-	referenceConfig.Load(appName) //appName is the unique identification of RPCService
+	referenceConfig.GenericLoad(appName) //appName is the unique identification of RPCService
 
 	time.Sleep(3 * time.Second)
 	println("\n\n\nstart to generic invoke")
diff --git a/filter/impl/generic_filter.go b/filter/impl/generic_filter.go
index b9ed9b62e..e23c34ebc 100644
--- a/filter/impl/generic_filter.go
+++ b/filter/impl/generic_filter.go
@@ -17,14 +17,16 @@
 
 package impl
 
+import (
+	"reflect"
+	"strings"
+)
 import (
 	"github.com/apache/dubbo-go/common/constant"
 	"github.com/apache/dubbo-go/common/extension"
 	"github.com/apache/dubbo-go/filter"
 	"github.com/apache/dubbo-go/protocol"
 	invocation2 "github.com/apache/dubbo-go/protocol/invocation"
-	"reflect"
-	"strings"
 )
 
 const (
diff --git a/filter/impl/generic_filter_test.go b/filter/impl/generic_filter_test.go
index bdeb95329..405bf789b 100644
--- a/filter/impl/generic_filter_test.go
+++ b/filter/impl/generic_filter_test.go
@@ -17,13 +17,13 @@
 
 package impl
 
-import (
-	"github.com/stretchr/testify/assert"
-)
 import (
 	"reflect"
 	"testing"
 )
+import (
+	"github.com/stretchr/testify/assert"
+)
 
 func Test_struct2MapAll(t *testing.T) {
 	var testData struct {
-- 
GitLab