From 0b6bc69afaccddd7d5c9b50b446f77d69f684f2c Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sat, 11 Sep 2021 21:28:47 +0800 Subject: [PATCH] reorg imports, format code (#1024) --- core/stores/clickhouse/clickhouse.go | 1 - core/stores/postgres/postgresql.go | 1 - core/trace/opentelemetry/tracer_test.go | 1 - tools/goctl/goctl.go | 3 +-- tools/goctl/rpc/cli/cli.go | 3 +-- tools/goctl/rpc/generator/gen_test.go | 1 - tools/goctl/util/console/console.go | 1 - 7 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/stores/clickhouse/clickhouse.go b/core/stores/clickhouse/clickhouse.go index a46d8703..c8737807 100644 --- a/core/stores/clickhouse/clickhouse.go +++ b/core/stores/clickhouse/clickhouse.go @@ -1,7 +1,6 @@ package clickhouse import ( - // imports the driver. _ "github.com/ClickHouse/clickhouse-go" "github.com/tal-tech/go-zero/core/stores/sqlx" ) diff --git a/core/stores/postgres/postgresql.go b/core/stores/postgres/postgresql.go index 84d9d486..6fb84185 100644 --- a/core/stores/postgres/postgresql.go +++ b/core/stores/postgres/postgresql.go @@ -1,7 +1,6 @@ package postgres import ( - // imports the driver. _ "github.com/lib/pq" "github.com/tal-tech/go-zero/core/stores/sqlx" ) diff --git a/core/trace/opentelemetry/tracer_test.go b/core/trace/opentelemetry/tracer_test.go index cdfa8add..cfe43d33 100644 --- a/core/trace/opentelemetry/tracer_test.go +++ b/core/trace/opentelemetry/tracer_test.go @@ -173,7 +173,6 @@ func TestExtractValidTraceContext(t *testing.T) { } func TestExtractInvalidTraceContext(t *testing.T) { - tests := []struct { name string header string diff --git a/tools/goctl/goctl.go b/tools/goctl/goctl.go index 5b0e92f0..2df43999 100644 --- a/tools/goctl/goctl.go +++ b/tools/goctl/goctl.go @@ -6,8 +6,6 @@ import ( "runtime" "github.com/logrusorgru/aurora" - "github.com/urfave/cli" - "github.com/tal-tech/go-zero/core/load" "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/stat" @@ -32,6 +30,7 @@ import ( rpc "github.com/tal-tech/go-zero/tools/goctl/rpc/cli" "github.com/tal-tech/go-zero/tools/goctl/tpl" "github.com/tal-tech/go-zero/tools/goctl/upgrade" + "github.com/urfave/cli" ) var commands = []cli.Command{ diff --git a/tools/goctl/rpc/cli/cli.go b/tools/goctl/rpc/cli/cli.go index a97fdbd6..46ec562b 100644 --- a/tools/goctl/rpc/cli/cli.go +++ b/tools/goctl/rpc/cli/cli.go @@ -6,11 +6,10 @@ import ( "path/filepath" "runtime" - "github.com/urfave/cli" - "github.com/tal-tech/go-zero/tools/goctl/rpc/generator" "github.com/tal-tech/go-zero/tools/goctl/util" "github.com/tal-tech/go-zero/tools/goctl/util/env" + "github.com/urfave/cli" ) // RPC is to generate rpc service code from a proto file by specifying a proto file using flag src, diff --git a/tools/goctl/rpc/generator/gen_test.go b/tools/goctl/rpc/generator/gen_test.go index 948cb1e0..31c28335 100644 --- a/tools/goctl/rpc/generator/gen_test.go +++ b/tools/goctl/rpc/generator/gen_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/stringx" conf "github.com/tal-tech/go-zero/tools/goctl/config" diff --git a/tools/goctl/util/console/console.go b/tools/goctl/util/console/console.go index a4502345..36a48859 100644 --- a/tools/goctl/util/console/console.go +++ b/tools/goctl/util/console/console.go @@ -6,7 +6,6 @@ import ( "runtime" "github.com/logrusorgru/aurora" - "github.com/tal-tech/go-zero/tools/goctl/vars" )