From 16274df7acf6406b939aeb66e26f0bb83821fb8c Mon Sep 17 00:00:00 2001
From: flycash <flycash@apache.org>
Date: Sat, 21 Mar 2020 21:01:39 +0800
Subject: [PATCH] Fix import

---
 config_center/apollo/impl.go           |  3 +--
 config_center/dynamic_configuration.go |  1 -
 config_center/nacos/impl.go            | 11 +++++------
 config_center/zookeeper/impl.go        |  4 ++--
 remoting/zookeeper/client.go           |  2 --
 5 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/config_center/apollo/impl.go b/config_center/apollo/impl.go
index d9c9ad2c3..1df3bedde 100644
--- a/config_center/apollo/impl.go
+++ b/config_center/apollo/impl.go
@@ -130,8 +130,7 @@ func (c *apolloConfiguration) GetRule(key string, opts ...cc.Option) (string, er
 
 // PublishConfig will publish the config with the (key, group, value) pair
 func (c *apolloConfiguration) PublishConfig(string, string, string) error {
-	// todo(@zouyx)
-	return nil
+	return errors.New("unsupport operation")
 }
 
 func (c *apolloConfiguration) GetProperties(key string, opts ...cc.Option) (string, error) {
diff --git a/config_center/dynamic_configuration.go b/config_center/dynamic_configuration.go
index e5284e89e..e643e011f 100644
--- a/config_center/dynamic_configuration.go
+++ b/config_center/dynamic_configuration.go
@@ -53,7 +53,6 @@ type DynamicConfiguration interface {
 
 	// PublishConfig will publish the config with the (key, group, value) pair
 	PublishConfig(string, string, string) error
-	
 }
 
 // Options ...
diff --git a/config_center/nacos/impl.go b/config_center/nacos/impl.go
index a1f9ff8cc..752bec7fc 100644
--- a/config_center/nacos/impl.go
+++ b/config_center/nacos/impl.go
@@ -18,7 +18,6 @@
 package nacos
 
 import (
-	"errors"
 	"strings"
 	"sync"
 )
@@ -92,16 +91,16 @@ func (nacos *nacosDynamicConfiguration) PublishConfig(key string, group string,
 	group = nacos.resolvedGroup(group)
 
 	ok, err := (*nacos.client.Client()).PublishConfig(vo.ConfigParam{
-		DataId:   key,
-		Group:    group,
-		Content:  value,
+		DataId:  key,
+		Group:   group,
+		Content: value,
 	})
 
 	if err != nil {
 		return err
 	}
 	if !ok {
-		return errors.New("publish config to Nocos failed")
+		return perrors.New("publish config to Nocos failed")
 	}
 	return nil
 }
@@ -170,7 +169,7 @@ func (nacos *nacosDynamicConfiguration) Destroy() {
 // resolvedGroup will regular the group. Now, it will replace the '/' with '-'.
 // '/' is a special character for nacos
 func (nacos *nacosDynamicConfiguration) resolvedGroup(group string) string {
-	if len(group) <=0 {
+	if len(group) <= 0 {
 		return group
 	}
 	return strings.ReplaceAll(group, "/", "-")
diff --git a/config_center/zookeeper/impl.go b/config_center/zookeeper/impl.go
index f8263e47c..38b0057d3 100644
--- a/config_center/zookeeper/impl.go
+++ b/config_center/zookeeper/impl.go
@@ -40,7 +40,7 @@ import (
 const (
 	// ZkClient
 	//zookeeper client name
-	ZkClient = "zk config_center"
+	ZkClient      = "zk config_center"
 	pathSeparator = "/"
 )
 
@@ -228,7 +228,7 @@ func (c *zookeeperDynamicConfiguration) RestartCallBack() bool {
 
 func (c *zookeeperDynamicConfiguration) getPath(key string, group string) string {
 	if len(key) <= 0 {
-		return c.buildPath(group) 
+		return c.buildPath(group)
 	}
 	return c.buildPath(group) + pathSeparator + key
 }
diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go
index 936b3b5ac..aeb249b30 100644
--- a/remoting/zookeeper/client.go
+++ b/remoting/zookeeper/client.go
@@ -431,8 +431,6 @@ func (z *ZookeeperClient) CreateWithValue(basePath string, value []byte) error {
 	return nil
 }
 
-
-
 // Delete ...
 func (z *ZookeeperClient) Delete(basePath string) error {
 	var (
-- 
GitLab