Skip to content

Commit

Permalink
Merge pull request #229 from Mulavar/style/imports-fmt
Browse files Browse the repository at this point in the history
style(*): format all imports with dubbogo/tools/imports-formatter
  • Loading branch information
AlexStocks committed Aug 3, 2021
2 parents 86575cd + e7a21a1 commit 71a2d60
Show file tree
Hide file tree
Showing 47 changed files with 107 additions and 85 deletions.
1 change: 1 addition & 0 deletions cmd/pixiu/pixiu.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
import (
_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
_ "github.com/apache/dubbo-go/metadata/service/inmemory"

"github.com/urfave/cli"
)

Expand Down
2 changes: 2 additions & 0 deletions pkg/client/dubbo/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import (
"github.com/apache/dubbo-go/common/constant"
dg "github.com/apache/dubbo-go/config"
"github.com/apache/dubbo-go/protocol/dubbo"

fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

"github.com/pkg/errors"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/client/dubbo/dubbo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

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

Expand Down
2 changes: 2 additions & 0 deletions pkg/client/dubbo/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

"github.com/pkg/errors"

"github.com/spf13/cast"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/client/dubbo/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

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

Expand Down
1 change: 1 addition & 0 deletions pkg/client/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

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

Expand Down
1 change: 1 addition & 0 deletions pkg/client/http/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

"github.com/pkg/errors"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/client/http/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

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

Expand Down
4 changes: 2 additions & 2 deletions pkg/client/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
)

import (
"github.com/pkg/errors"

"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"

"github.com/pkg/errors"
)

import (
Expand Down
4 changes: 3 additions & 1 deletion pkg/common/constant/pixiu.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package constant

import "time"
import (
"time"
)

// default timeout 1s.
const (
Expand Down
1 change: 1 addition & 0 deletions pkg/common/yaml/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

import (
perrors "github.com/pkg/errors"

"gopkg.in/yaml.v2"
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/config/api_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ import (
import (
fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
fr "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config/ratelimit"

etcdv3 "github.com/dubbogo/gost/database/kv/etcd/v3"

perrors "github.com/pkg/errors"

"go.etcd.io/etcd/api/v3/mvccpb"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/config/api_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

import (
"github.com/ghodss/yaml"

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

Expand Down
1 change: 1 addition & 0 deletions pkg/config/config_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

import (
"github.com/ghodss/yaml"

"github.com/goinggo/mapstructure"
)

Expand Down
6 changes: 2 additions & 4 deletions pkg/context/http/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ import (

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/stretchr/testify/assert"
)

import (
fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/context"

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

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/header/header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

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

Expand Down
6 changes: 3 additions & 3 deletions pkg/filter/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
)

import (
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/global"

fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/context"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/filter"

"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/global"
)

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/filter/ratelimit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"github.com/alibaba/sentinel-golang/core/flow"
"github.com/alibaba/sentinel-golang/logging"

"github.com/pkg/errors"

"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config/ratelimit"

"github.com/pkg/errors"
)

import (
Expand Down
4 changes: 3 additions & 1 deletion pkg/filter/ratelimit/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package ratelimit

import "testing"
import (
"testing"
)

func TestInit(t *testing.T) {
c := GetMockedRateLimitConfig()
Expand Down
4 changes: 3 additions & 1 deletion pkg/filter/ratelimit/logger_warpper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package ratelimit

import "github.com/apache/dubbo-go-pixiu/pkg/logger"
import (
"github.com/apache/dubbo-go-pixiu/pkg/logger"
)

// loggerWrapper
type loggerWrapper struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/ratelimit/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package ratelimit

import (
"github.com/alibaba/sentinel-golang/core/flow"

"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config/ratelimit"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/filter/ratelimit/rate_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
import (
sentinel "github.com/alibaba/sentinel-golang/api"
"github.com/alibaba/sentinel-golang/core/base"

"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config/ratelimit"
fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/context"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/filter"
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/remote/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
_ "github.com/apache/dubbo-go/filter/filter_impl"
_ "github.com/apache/dubbo-go/registry/protocol"
_ "github.com/apache/dubbo-go/registry/zookeeper"

"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/context"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/filter"
Expand Down
8 changes: 4 additions & 4 deletions pkg/initialize/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

package initialize

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
)

import (
"github.com/apache/dubbo-go-pixiu/pkg/filter/accesslog"
"github.com/apache/dubbo-go-pixiu/pkg/filter/api"
Expand All @@ -30,10 +34,6 @@ import (
sa "github.com/apache/dubbo-go-pixiu/pkg/service/api"
)

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
)

// Run start init.
func Run(config config.APIConfig) {
filterInit(&config)
Expand Down
2 changes: 2 additions & 0 deletions pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import (

import (
"github.com/ghodss/yaml"

perrors "github.com/pkg/errors"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/pixiu/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
)

import (
"github.com/pkg/errors"

fc "github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

"github.com/pkg/errors"
)

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/pixiu/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

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

Expand Down
3 changes: 3 additions & 0 deletions pkg/pixiu/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ import (

import (
"go.opentelemetry.io/otel/exporters/prometheus"

"go.opentelemetry.io/otel/metric/global"

export "go.opentelemetry.io/otel/sdk/export/metric"
"go.opentelemetry.io/otel/sdk/metric/aggregator/histogram"
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
selector "go.opentelemetry.io/otel/sdk/metric/selector/simple"
"go.opentelemetry.io/otel/sdk/resource"

semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
)

Expand Down
1 change: 0 additions & 1 deletion pkg/pixiu/pixiu_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/apache/dubbo-go-pixiu/pkg/client/dubbo"
"github.com/apache/dubbo-go-pixiu/pkg/common/constant"
"github.com/apache/dubbo-go-pixiu/pkg/config"
// The filter needs to be initialized
_ "github.com/apache/dubbo-go-pixiu/pkg/filter"
"github.com/apache/dubbo-go-pixiu/pkg/initialize"
"github.com/apache/dubbo-go-pixiu/pkg/logger"
Expand Down
2 changes: 2 additions & 0 deletions pkg/registry/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import (
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"

consul "github.com/hashicorp/consul/api"

perrors "github.com/pkg/errors"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/registry/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/apache/dubbo-go/common/extension"
_ "github.com/apache/dubbo-go/registry/consul"
"github.com/apache/dubbo-go/remoting/consul"

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

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

package registry

import "github.com/apache/dubbo-go/common"
import (
"github.com/apache/dubbo-go/common"
)

// Loader this interface defined for load services from different kinds registry, such as nacos,consul,zookeeper.
type Loader interface {
Expand Down
1 change: 1 addition & 0 deletions pkg/registry/zookeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

import (
"github.com/apache/dubbo-go/common"

gxzookeeper "github.com/dubbogo/gost/database/kv/zk"
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/registry/zookeeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ import (
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"

"github.com/dubbogo/go-zookeeper/zk"

gxzookeeper "github.com/dubbogo/gost/database/kv/zk"

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

Expand Down
6 changes: 2 additions & 4 deletions pkg/router/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ import (
"testing"
)

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

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

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

func TestGetURIParams(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/router/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import (
import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

"github.com/emirpasic/gods/trees/avltree"

"github.com/pkg/errors"
)

Expand Down
9 changes: 4 additions & 5 deletions pkg/router/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ import (
"testing"
)

import (
"github.com/emirpasic/gods/trees/avltree"
"github.com/stretchr/testify/assert"
)

import (
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/api/config"
"github.com/dubbogo/dubbo-go-pixiu-filter/pkg/router"

"github.com/emirpasic/gods/trees/avltree"

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

func getMockMethod(verb config.HTTPVerb) config.Method {
Expand Down
Loading

0 comments on commit 71a2d60

Please sign in to comment.