Skip to content

Commit

Permalink
style: use gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou committed Mar 3, 2024
1 parent 42a1844 commit c2401e2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
3 changes: 2 additions & 1 deletion v2/client/circuit_breaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package client

import (
"strings"

"github.com/kitex-contrib/config-nacos/v2/nacos"
"github.com/kitex-contrib/config-nacos/v2/utils"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"strings"

"github.com/cloudwego/kitex/client"
"github.com/cloudwego/kitex/pkg/circuitbreak"
Expand Down
5 changes: 3 additions & 2 deletions v2/example/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ package main
import (
"context"
"fmt"
"log"
"time"

"github.com/cloudwego/kitex-examples/kitex_gen/api"
"github.com/cloudwego/kitex-examples/kitex_gen/api/echo"
"github.com/cloudwego/kitex/client"
Expand All @@ -26,8 +29,6 @@ import (
"github.com/kitex-contrib/config-nacos/v2/nacos"
"github.com/kitex-contrib/config-nacos/v2/utils"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"log"
"time"
)

type configLog struct{}
Expand Down
3 changes: 2 additions & 1 deletion v2/example/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ package main

import (
"context"
"log"

"github.com/cloudwego/kitex-examples/kitex_gen/api"
"github.com/cloudwego/kitex-examples/kitex_gen/api/echo"
"github.com/cloudwego/kitex/pkg/klog"
"github.com/cloudwego/kitex/pkg/rpcinfo"
"github.com/cloudwego/kitex/server"
"github.com/kitex-contrib/config-nacos/v2/nacos"
nacosserver "github.com/kitex-contrib/config-nacos/v2/server"
"log"
)

var _ api.Echo = &EchoImpl{}
Expand Down
5 changes: 3 additions & 2 deletions v2/nacos/nacos.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ package nacos

import (
"bytes"
"sync"
"text/template"

"github.com/cloudwego/kitex/pkg/klog"
"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"
"sync"
"text/template"
)

// callbackHandler ...
Expand Down
5 changes: 3 additions & 2 deletions v2/nacos/nacos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ package nacos

import (
"fmt"
"sync"
"testing"

"github.com/nacos-group/nacos-sdk-go/v2/model"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"github.com/stretchr/testify/assert"
"sync"
"testing"
)

type fakeNacos struct {
Expand Down
5 changes: 3 additions & 2 deletions v2/nacos/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package nacos

import (
"fmt"

"github.com/nacos-group/nacos-sdk-go/v2/vo"
"sigs.k8s.io/yaml"
)
Expand Down Expand Up @@ -48,13 +49,13 @@ var _ ConfigParser = &parser{}

// ConfigParser the parser for nacos config.
type ConfigParser interface {
Decode(kind string, data string, config interface{}) error
Decode(kind, data string, config interface{}) error
}

type parser struct{}

// Decode decodes the data to struct in specified format.
func (p *parser) Decode(kind string, data string, config interface{}) error {
func (p *parser) Decode(kind, data string, config interface{}) error {
switch kind {
case "yaml", "json":
// since YAML is a superset of JSON, it can parse JSON using a YAML parser
Expand Down
3 changes: 2 additions & 1 deletion v2/server/limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package server

import (
"sync/atomic"

"github.com/kitex-contrib/config-nacos/v2/nacos"
"github.com/kitex-contrib/config-nacos/v2/utils"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
"sync/atomic"

"github.com/cloudwego/kitex/pkg/klog"
"github.com/cloudwego/kitex/pkg/limit"
Expand Down

0 comments on commit c2401e2

Please sign in to comment.