Skip to content

Commit

Permalink
chore: modify the variant to make sure conform to naming convention
Browse files Browse the repository at this point in the history
Signed-off-by: PennyYoon <525296438@qq.com>
  • Loading branch information
Chenxulin97 committed Nov 19, 2023
1 parent 16c9e95 commit e423ed8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions opengemini/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ type Client interface {

// Config is used to construct a openGemini Client instance.
type Config struct {
// AddressList Configure the service URL for the openGemini service.
// Addresses Configure the service URL for the openGemini service.
// This parameter is required.
AddressList []*Address
Addresses []*Address
// AuthConfig configuration information for authentication.
AuthConfig *AuthConfig
// BatchConfig configuration information for batch processing.
Expand Down
4 changes: 2 additions & 2 deletions opengemini/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type client struct {
}

func newClient(c *Config) (Client, error) {
if len(c.AddressList) == 0 {
if len(c.Addresses) == 0 {
return nil, errors.New("must have at least one address")
}
if c.AuthConfig != nil {
Expand All @@ -39,7 +39,7 @@ func newClient(c *Config) (Client, error) {
}
client := &client{
config: c,
serverUrls: buildServerUrls(c.AddressList, c.TlsEnabled),
serverUrls: buildServerUrls(c.Addresses, c.TlsEnabled),
cli: newHttpClient(*c),
}
return client, nil
Expand Down
4 changes: 2 additions & 2 deletions opengemini/client_ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func TestPingSuccess(t *testing.T) {
c := testNewClient(t, &Config{
AddressList: []*Address{{
Addresses: []*Address{{
Host: "localhost",
Port: 8086,
}},
Expand All @@ -19,7 +19,7 @@ func TestPingSuccess(t *testing.T) {

func TestPingFail(t *testing.T) {
c := testNewClient(t, &Config{
AddressList: []*Address{{
Addresses: []*Address{{
Host: "localhost",
Port: 8086,
}, {
Expand Down

0 comments on commit e423ed8

Please sign in to comment.