Skip to content

Commit

Permalink
update nacos v1 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 authored Nov 27, 2022
1 parent cf07dc5 commit 64a6483
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 228 deletions.
1 change: 1 addition & 0 deletions bytes/bytes_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"testing"
)

import (
"github.com/stretchr/testify/assert"
)
Expand Down
10 changes: 4 additions & 6 deletions database/kv/nacos/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/v2/clients"
"github.com/nacos-group/nacos-sdk-go/v2/clients/config_client"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/clients/config_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
)

var (
Expand Down Expand Up @@ -120,13 +120,11 @@ func (n *NacosConfigClient) Close() {
n.activeCount--
if n.share {
if n.activeCount == 0 {
n.client.CloseClient()
n.client = nil
atomic.StoreUint32(&n.valid, 0)
delete(configClientPool.configClient, n.name)
}
} else {
n.client.CloseClient()
n.client = nil
atomic.StoreUint32(&n.valid, 0)
delete(configClientPool.configClient, n.name)
Expand Down
7 changes: 3 additions & 4 deletions database/kv/nacos/config_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"

"github.com/stretchr/testify/assert"
)
Expand All @@ -45,7 +45,7 @@ func TestStructAlign(t *testing.T) {
}
}

//TestNewNacosConfigClient config client
// TestNewNacosConfigClient config client
func TestNewNacosConfigClient(t *testing.T) {

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

Expand Down
10 changes: 4 additions & 6 deletions database/kv/nacos/naming_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/v2/clients"
"github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
)

var (
Expand Down Expand Up @@ -121,13 +121,11 @@ func (n *NacosNamingClient) Close() {
n.activeCount--
if n.share {
if n.activeCount == 0 {
n.client.CloseClient()
n.client = nil
atomic.StoreUint32(&n.valid, 0)
delete(namingClientPool.namingClient, n.name)
}
} else {
n.client.CloseClient()
n.client = nil
atomic.StoreUint32(&n.valid, 0)
delete(namingClientPool.namingClient, n.name)
Expand Down
3 changes: 2 additions & 1 deletion database/kv/nacos/naming_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/common/constant"

"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/k0kubun/pp v3.0.1+incompatible
github.com/mattn/go-isatty v0.0.14
github.com/nacos-group/nacos-sdk-go/v2 v2.1.2
github.com/nacos-group/nacos-sdk-go v1.1.3
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/pkg/errors v0.9.1
github.com/shirou/gopsutil/v3 v3.22.2
Expand Down
235 changes: 26 additions & 209 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions hash/consistent/consistent.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

import (
"github.com/pkg/errors"

"golang.org/x/crypto/blake2b"
)

Expand Down
2 changes: 2 additions & 0 deletions math/big/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import (
"strconv"
"strings"
"testing"
)

import (
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 3 additions & 1 deletion strings/slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package gxstrings

import "testing"
import (
"testing"
)

func BenchmarkStrConvByteFast(b *testing.B) {
var s = "gost"
Expand Down
4 changes: 4 additions & 0 deletions sync/base_worker_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ import (
"fmt"
"runtime/debug"
"sync"
)

import (
"go.uber.org/atomic"
)

import (
gxlog "github.com/dubbogo/gost/log"
)

Expand Down

0 comments on commit 64a6483

Please sign in to comment.