Skip to content

Commit 64a6483

Browse files
authored
update nacos v1 (#109)
1 parent cf07dc5 commit 64a6483

File tree

11 files changed

+51
-228
lines changed

11 files changed

+51
-228
lines changed

bytes/bytes_pool_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"testing"
2323
)
24+
2425
import (
2526
"github.com/stretchr/testify/assert"
2627
)

database/kv/nacos/config_client.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
)
2424

2525
import (
26-
"github.com/nacos-group/nacos-sdk-go/v2/clients"
27-
"github.com/nacos-group/nacos-sdk-go/v2/clients/config_client"
28-
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
29-
"github.com/nacos-group/nacos-sdk-go/v2/vo"
26+
"github.com/nacos-group/nacos-sdk-go/clients"
27+
"github.com/nacos-group/nacos-sdk-go/clients/config_client"
28+
"github.com/nacos-group/nacos-sdk-go/common/constant"
29+
"github.com/nacos-group/nacos-sdk-go/vo"
3030
)
3131

3232
var (
@@ -120,13 +120,11 @@ func (n *NacosConfigClient) Close() {
120120
n.activeCount--
121121
if n.share {
122122
if n.activeCount == 0 {
123-
n.client.CloseClient()
124123
n.client = nil
125124
atomic.StoreUint32(&n.valid, 0)
126125
delete(configClientPool.configClient, n.name)
127126
}
128127
} else {
129-
n.client.CloseClient()
130128
n.client = nil
131129
atomic.StoreUint32(&n.valid, 0)
132130
delete(configClientPool.configClient, n.name)

database/kv/nacos/config_client_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727
)
2828

2929
import (
30-
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
31-
"github.com/nacos-group/nacos-sdk-go/v2/vo"
30+
"github.com/nacos-group/nacos-sdk-go/common/constant"
31+
"github.com/nacos-group/nacos-sdk-go/vo"
3232

3333
"github.com/stretchr/testify/assert"
3434
)
@@ -45,7 +45,7 @@ func TestStructAlign(t *testing.T) {
4545
}
4646
}
4747

48-
//TestNewNacosConfigClient config client
48+
// TestNewNacosConfigClient config client
4949
func TestNewNacosConfigClient(t *testing.T) {
5050

5151
scs := []constant.ServerConfig{*constant.NewServerConfig("console.nacos.io", 80)}
@@ -89,7 +89,6 @@ func TestPublishConfig(t *testing.T) {
8989
NotLoadCacheAtStart: true,
9090
LogDir: "/tmp/nacos/log",
9191
CacheDir: "/tmp/nacos/cache",
92-
LogRollingConfig: &constant.ClientLogRollingConfig{MaxAge: 3},
9392
LogLevel: "debug",
9493
}
9594

database/kv/nacos/naming_client.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
)
2424

2525
import (
26-
"github.com/nacos-group/nacos-sdk-go/v2/clients"
27-
"github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
28-
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
29-
"github.com/nacos-group/nacos-sdk-go/v2/vo"
26+
"github.com/nacos-group/nacos-sdk-go/clients"
27+
"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
28+
"github.com/nacos-group/nacos-sdk-go/common/constant"
29+
"github.com/nacos-group/nacos-sdk-go/vo"
3030
)
3131

3232
var (
@@ -121,13 +121,11 @@ func (n *NacosNamingClient) Close() {
121121
n.activeCount--
122122
if n.share {
123123
if n.activeCount == 0 {
124-
n.client.CloseClient()
125124
n.client = nil
126125
atomic.StoreUint32(&n.valid, 0)
127126
delete(namingClientPool.namingClient, n.name)
128127
}
129128
} else {
130-
n.client.CloseClient()
131129
n.client = nil
132130
atomic.StoreUint32(&n.valid, 0)
133131
delete(namingClientPool.namingClient, n.name)

database/kv/nacos/naming_client_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import (
2222
)
2323

2424
import (
25-
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
25+
"github.com/nacos-group/nacos-sdk-go/common/constant"
26+
2627
"github.com/stretchr/testify/assert"
2728
)
2829

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
1010
github.com/k0kubun/pp v3.0.1+incompatible
1111
github.com/mattn/go-isatty v0.0.14
12-
github.com/nacos-group/nacos-sdk-go/v2 v2.1.2
12+
github.com/nacos-group/nacos-sdk-go v1.1.3
1313
github.com/natefinch/lumberjack v2.0.0+incompatible
1414
github.com/pkg/errors v0.9.1
1515
github.com/shirou/gopsutil/v3 v3.22.2

go.sum

Lines changed: 26 additions & 209 deletions
Large diffs are not rendered by default.

hash/consistent/consistent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
import (
3030
"github.com/pkg/errors"
31+
3132
"golang.org/x/crypto/blake2b"
3233
)
3334

math/big/decimal_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import (
2222
"strconv"
2323
"strings"
2424
"testing"
25+
)
2526

27+
import (
2628
"github.com/stretchr/testify/require"
2729
)
2830

strings/slice_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
package gxstrings
1919

20-
import "testing"
20+
import (
21+
"testing"
22+
)
2123

2224
func BenchmarkStrConvByteFast(b *testing.B) {
2325
var s = "gost"

0 commit comments

Comments
 (0)