You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2021/09/04 15:58:10 UTC
[dubbo-go-samples] 05/08: style(*): format imports with
dubbogo/tools/imports-formatter (#188)
This is an automated email from the ASF dual-hosted git repository.
zhaoyunxing pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
commit aa1d3248fd2c6e74c42b017203f0f869d71a9f2e
Author: Mulavar <97...@qq.com>
AuthorDate: Wed Aug 18 21:30:40 2021 +0800
style(*): format imports with dubbogo/tools/imports-formatter (#188)
Co-authored-by: dongjianhui03 <do...@meituan.com>
---
game/go-server-game/cmd/server.go | 16 +++++++---------
game/go-server-game/tests/integration/main_test.go | 1 +
game/go-server-gate/cmd/server.go | 1 +
.../dubbo3/pb/dubbogo-grpc/server/grpcgo-server/main.go | 2 --
general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go | 1 -
generic/protobufjson/go-client/cmd/client.go | 9 ++++-----
generic/protobufjson/go-server/cmd/server.go | 8 ++++----
generic/protobufjson/go-server/pkg/user.pb.go | 8 ++++++--
.../go-server/tests/integration/main_test.go | 12 ++++++------
.../go-server/tests/integration/userprovider_test.go | 5 ++++-
multi-zone/go-server-hz/tests/integration/main_test.go | 1 +
.../go-server-hz/tests/integration/userprovider_test.go | 1 +
multi-zone/go-server-sh/tests/integration/main_test.go | 1 +
.../go-server-sh/tests/integration/userprovider_test.go | 1 +
registry/servicediscovery/etcd/go-client/cmd/client.go | 2 ++
registry/servicediscovery/etcd/go-server/cmd/server.go | 4 ++--
registry/servicediscovery/etcd/go-server/pkg/user.go | 7 +++----
.../etcd/go-server/tests/integration/main_test.go | 15 ++++++++-------
.../go-server/tests/integration/userprovider_test.go | 1 +
tracing/dubbo/go-server/tests/integration/main_test.go | 6 ++----
.../go-server/tests/integration/userprovider_test.go | 9 +++++++--
tracing/grpc/go-server/app/helloworld.pb.go | 4 ----
22 files changed, 62 insertions(+), 53 deletions(-)
diff --git a/game/go-server-game/cmd/server.go b/game/go-server-game/cmd/server.go
index e0853a8..e45b268 100755
--- a/game/go-server-game/cmd/server.go
+++ b/game/go-server-game/cmd/server.go
@@ -5,26 +5,24 @@ import (
"os/signal"
"syscall"
"time"
+)
- hessian "github.com/apache/dubbo-go-hessian2"
-
+import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
-
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
"dubbo.apache.org/dubbo-go/v3/common/logger"
-
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
-
_ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
-
_ "dubbo.apache.org/dubbo-go/v3/metadata/service/local"
-
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
-
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
-
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
+ hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+import (
"github.com/apache/dubbo-go-samples/game/go-server-game/pkg"
"github.com/apache/dubbo-go-samples/game/pkg/pojo"
)
diff --git a/game/go-server-game/tests/integration/main_test.go b/game/go-server-game/tests/integration/main_test.go
index 057d58f..dc7a38e 100755
--- a/game/go-server-game/tests/integration/main_test.go
+++ b/game/go-server-game/tests/integration/main_test.go
@@ -16,6 +16,7 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
hessian "github.com/apache/dubbo-go-hessian2"
)
diff --git a/game/go-server-gate/cmd/server.go b/game/go-server-gate/cmd/server.go
index 976445c..5fd64fc 100755
--- a/game/go-server-gate/cmd/server.go
+++ b/game/go-server-gate/cmd/server.go
@@ -23,6 +23,7 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
hessian "github.com/apache/dubbo-go-hessian2"
)
diff --git a/general/dubbo3/pb/dubbogo-grpc/server/grpcgo-server/main.go b/general/dubbo3/pb/dubbogo-grpc/server/grpcgo-server/main.go
index 87f308b..df828eb 100644
--- a/general/dubbo3/pb/dubbogo-grpc/server/grpcgo-server/main.go
+++ b/general/dubbo3/pb/dubbogo-grpc/server/grpcgo-server/main.go
@@ -28,8 +28,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
-
- "google.golang.org/grpc/reflection"
)
import (
diff --git a/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go b/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
index 89625a4..dc13874 100644
--- a/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
+++ b/general/dubbo3/pb/dubbogo-java/protobuf/helloworld.pb.go
@@ -21,7 +21,6 @@ import (
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
-
status "google.golang.org/grpc/status"
)
diff --git a/generic/protobufjson/go-client/cmd/client.go b/generic/protobufjson/go-client/cmd/client.go
index b2964cf..146cbb4 100644
--- a/generic/protobufjson/go-client/cmd/client.go
+++ b/generic/protobufjson/go-client/cmd/client.go
@@ -27,11 +27,6 @@ import (
)
import (
- hessian "github.com/apache/dubbo-go-hessian2"
- "github.com/dubbogo/gost/log"
-)
-
-import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
"dubbo.apache.org/dubbo-go/v3/common/logger"
@@ -41,6 +36,10 @@ import (
"dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
+ hessian "github.com/apache/dubbo-go-hessian2"
+
+ "github.com/dubbogo/gost/log"
)
var (
diff --git a/generic/protobufjson/go-server/cmd/server.go b/generic/protobufjson/go-server/cmd/server.go
index 87a9d5f..5d78ee0 100644
--- a/generic/protobufjson/go-server/cmd/server.go
+++ b/generic/protobufjson/go-server/cmd/server.go
@@ -26,10 +26,6 @@ import (
)
import (
- "github.com/apache/dubbo-go-samples/generic/protobufjson/go-server/pkg"
-)
-
-import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
"dubbo.apache.org/dubbo-go/v3/common/logger"
@@ -41,6 +37,10 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
)
+import (
+ "github.com/apache/dubbo-go-samples/generic/protobufjson/go-server/pkg"
+)
+
func init() {
config.SetProviderService(new(pkg.UserProvider))
}
diff --git a/generic/protobufjson/go-server/pkg/user.pb.go b/generic/protobufjson/go-server/pkg/user.pb.go
index 1c1ef8b..1166267 100644
--- a/generic/protobufjson/go-server/pkg/user.pb.go
+++ b/generic/protobufjson/go-server/pkg/user.pb.go
@@ -7,12 +7,16 @@
package pkg
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+)
+
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
diff --git a/generic/protobufjson/go-server/tests/integration/main_test.go b/generic/protobufjson/go-server/tests/integration/main_test.go
index 0c776e7..44153bd 100644
--- a/generic/protobufjson/go-server/tests/integration/main_test.go
+++ b/generic/protobufjson/go-server/tests/integration/main_test.go
@@ -20,6 +20,12 @@
package integration
import (
+ "os"
+ "testing"
+ "time"
+)
+
+import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
@@ -31,12 +37,6 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
)
-import (
- "os"
- "testing"
- "time"
-)
-
var appName = "UserConsumerTest"
var referenceConfig = config.ReferenceConfig{
InterfaceName: "org.apache.dubbo.UserProvider",
diff --git a/generic/protobufjson/go-server/tests/integration/userprovider_test.go b/generic/protobufjson/go-server/tests/integration/userprovider_test.go
index 43ef763..0ad6d74 100644
--- a/generic/protobufjson/go-server/tests/integration/userprovider_test.go
+++ b/generic/protobufjson/go-server/tests/integration/userprovider_test.go
@@ -21,12 +21,15 @@ package integration
import (
"context"
- "github.com/stretchr/testify/assert"
"testing"
)
+
import (
"dubbo.apache.org/dubbo-go/v3/config"
+
hessian "github.com/apache/dubbo-go-hessian2"
+
+ "github.com/stretchr/testify/assert"
)
func TestGetUser(t *testing.T) {
diff --git a/multi-zone/go-server-hz/tests/integration/main_test.go b/multi-zone/go-server-hz/tests/integration/main_test.go
index 9a3edab..d028c55 100644
--- a/multi-zone/go-server-hz/tests/integration/main_test.go
+++ b/multi-zone/go-server-hz/tests/integration/main_test.go
@@ -36,6 +36,7 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
hessian "github.com/apache/dubbo-go-hessian2"
)
diff --git a/multi-zone/go-server-hz/tests/integration/userprovider_test.go b/multi-zone/go-server-hz/tests/integration/userprovider_test.go
index 89988b7..a506b8d 100644
--- a/multi-zone/go-server-hz/tests/integration/userprovider_test.go
+++ b/multi-zone/go-server-hz/tests/integration/userprovider_test.go
@@ -23,6 +23,7 @@ import (
"context"
"testing"
)
+
import (
"github.com/stretchr/testify/assert"
)
diff --git a/multi-zone/go-server-sh/tests/integration/main_test.go b/multi-zone/go-server-sh/tests/integration/main_test.go
index 9a3edab..d028c55 100644
--- a/multi-zone/go-server-sh/tests/integration/main_test.go
+++ b/multi-zone/go-server-sh/tests/integration/main_test.go
@@ -36,6 +36,7 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
hessian "github.com/apache/dubbo-go-hessian2"
)
diff --git a/multi-zone/go-server-sh/tests/integration/userprovider_test.go b/multi-zone/go-server-sh/tests/integration/userprovider_test.go
index c8d3dd8..04ab061 100644
--- a/multi-zone/go-server-sh/tests/integration/userprovider_test.go
+++ b/multi-zone/go-server-sh/tests/integration/userprovider_test.go
@@ -23,6 +23,7 @@ import (
"context"
"testing"
)
+
import (
"github.com/stretchr/testify/assert"
)
diff --git a/registry/servicediscovery/etcd/go-client/cmd/client.go b/registry/servicediscovery/etcd/go-client/cmd/client.go
index 41a0038..866126c 100644
--- a/registry/servicediscovery/etcd/go-client/cmd/client.go
+++ b/registry/servicediscovery/etcd/go-client/cmd/client.go
@@ -37,7 +37,9 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/etcdv3"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery"
+
hessian "github.com/apache/dubbo-go-hessian2"
+
"github.com/dubbogo/gost/log"
)
diff --git a/registry/servicediscovery/etcd/go-server/cmd/server.go b/registry/servicediscovery/etcd/go-server/cmd/server.go
index 1f3c38e..b32906c 100644
--- a/registry/servicediscovery/etcd/go-server/cmd/server.go
+++ b/registry/servicediscovery/etcd/go-server/cmd/server.go
@@ -26,8 +26,6 @@ import (
)
import (
- hessian "github.com/apache/dubbo-go-hessian2"
-
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
"dubbo.apache.org/dubbo-go/v3/common/logger"
@@ -42,6 +40,8 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/etcdv3"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery"
+
+ hessian "github.com/apache/dubbo-go-hessian2"
)
import (
diff --git a/registry/servicediscovery/etcd/go-server/pkg/user.go b/registry/servicediscovery/etcd/go-server/pkg/user.go
index bda7344..75d0916 100644
--- a/registry/servicediscovery/etcd/go-server/pkg/user.go
+++ b/registry/servicediscovery/etcd/go-server/pkg/user.go
@@ -23,12 +23,11 @@ import (
)
import (
- "github.com/dubbogo/gost/log"
-)
-
-import (
"dubbo.apache.org/dubbo-go/v3/config"
+
hessian "github.com/apache/dubbo-go-hessian2"
+
+ "github.com/dubbogo/gost/log"
)
func init() {
diff --git a/registry/servicediscovery/etcd/go-server/tests/integration/main_test.go b/registry/servicediscovery/etcd/go-server/tests/integration/main_test.go
index ff9821e..b34dd03 100644
--- a/registry/servicediscovery/etcd/go-server/tests/integration/main_test.go
+++ b/registry/servicediscovery/etcd/go-server/tests/integration/main_test.go
@@ -20,6 +20,13 @@
package integration
import (
+ "context"
+ "os"
+ "testing"
+ "time"
+)
+
+import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
@@ -33,14 +40,8 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/etcdv3"
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery"
- hessian "github.com/apache/dubbo-go-hessian2"
-)
-import (
- "context"
- "os"
- "testing"
- "time"
+ hessian "github.com/apache/dubbo-go-hessian2"
)
var userProvider = new(UserProvider)
diff --git a/registry/servicediscovery/etcd/go-server/tests/integration/userprovider_test.go b/registry/servicediscovery/etcd/go-server/tests/integration/userprovider_test.go
index dc29d9a..7183e64 100644
--- a/registry/servicediscovery/etcd/go-server/tests/integration/userprovider_test.go
+++ b/registry/servicediscovery/etcd/go-server/tests/integration/userprovider_test.go
@@ -23,6 +23,7 @@ import (
"context"
"testing"
)
+
import (
"github.com/stretchr/testify/assert"
)
diff --git a/tracing/dubbo/go-server/tests/integration/main_test.go b/tracing/dubbo/go-server/tests/integration/main_test.go
index f29ce68..ee19ca1 100644
--- a/tracing/dubbo/go-server/tests/integration/main_test.go
+++ b/tracing/dubbo/go-server/tests/integration/main_test.go
@@ -27,10 +27,6 @@ import (
)
import (
- hessian "github.com/apache/dubbo-go-hessian2"
-)
-
-import (
_ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
_ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
_ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
@@ -44,6 +40,8 @@ import (
_ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
_ "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery"
_ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+
+ hessian "github.com/apache/dubbo-go-hessian2"
)
var userProvider = new(UserProvider)
diff --git a/tracing/dubbo/go-server/tests/integration/userprovider_test.go b/tracing/dubbo/go-server/tests/integration/userprovider_test.go
index d795eb9..537111f 100644
--- a/tracing/dubbo/go-server/tests/integration/userprovider_test.go
+++ b/tracing/dubbo/go-server/tests/integration/userprovider_test.go
@@ -23,15 +23,20 @@ import (
"context"
"testing"
)
+
import (
+ "dubbo.apache.org/dubbo-go/v3/common/logger"
+
"github.com/dubbogo/gost/log"
+
"github.com/opentracing/opentracing-go"
+
zipkinot "github.com/openzipkin-contrib/zipkin-go-opentracing"
+
"github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
- "github.com/stretchr/testify/assert"
- "dubbo.apache.org/dubbo-go/v3/common/logger"
+ "github.com/stretchr/testify/assert"
)
func TestGetUser(t *testing.T) {
diff --git a/tracing/grpc/go-server/app/helloworld.pb.go b/tracing/grpc/go-server/app/helloworld.pb.go
index 43c9335..e8bf208 100644
--- a/tracing/grpc/go-server/app/helloworld.pb.go
+++ b/tracing/grpc/go-server/app/helloworld.pb.go
@@ -19,10 +19,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
-
- "google.golang.org/grpc/codes"
-
- "google.golang.org/grpc/status"
)
var _ = proto.Marshal