From 49b86c56e373b6295c16c82dc84dd102b5d9c934 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 29 Jan 2020 22:40:43 +0000 Subject: [PATCH] go fmt --- agent/input/discord/discord.go | 2 +- agent/input/slack/slack.go | 2 +- agent/input/telegram/telegram.go | 2 +- config/source/cli/cli.go | 2 +- config/source/cli/cli_test.go | 2 +- debug/service/handler/debug.go | 4 ++-- defaults.go | 4 ++++ web/service.go | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/agent/input/discord/discord.go b/agent/input/discord/discord.go index 39ff21f3..f30a45b8 100644 --- a/agent/input/discord/discord.go +++ b/agent/input/discord/discord.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/bwmarrin/discordgo" - "github.com/micro/go-micro/agent/input" "github.com/micro/cli/v2" + "github.com/micro/go-micro/agent/input" ) func init() { diff --git a/agent/input/slack/slack.go b/agent/input/slack/slack.go index 8336b1d8..53472c87 100644 --- a/agent/input/slack/slack.go +++ b/agent/input/slack/slack.go @@ -4,9 +4,9 @@ import ( "errors" "sync" + "github.com/micro/cli/v2" "github.com/micro/go-micro/agent/input" "github.com/nlopes/slack" - "github.com/micro/cli/v2" ) type slackInput struct { diff --git a/agent/input/telegram/telegram.go b/agent/input/telegram/telegram.go index eced5d5a..f7839714 100644 --- a/agent/input/telegram/telegram.go +++ b/agent/input/telegram/telegram.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/micro/go-micro/agent/input" "github.com/micro/cli/v2" + "github.com/micro/go-micro/agent/input" tgbotapi "gopkg.in/telegram-bot-api.v4" ) diff --git a/config/source/cli/cli.go b/config/source/cli/cli.go index ea9a3048..96e58331 100644 --- a/config/source/cli/cli.go +++ b/config/source/cli/cli.go @@ -8,9 +8,9 @@ import ( "time" "github.com/imdario/mergo" + "github.com/micro/cli/v2" "github.com/micro/go-micro/config/cmd" "github.com/micro/go-micro/config/source" - "github.com/micro/cli/v2" ) type cliSource struct { diff --git a/config/source/cli/cli_test.go b/config/source/cli/cli_test.go index a460befa..53985860 100644 --- a/config/source/cli/cli_test.go +++ b/config/source/cli/cli_test.go @@ -5,9 +5,9 @@ import ( "os" "testing" + "github.com/micro/cli/v2" "github.com/micro/go-micro/config/cmd" "github.com/micro/go-micro/config/source" - "github.com/micro/cli/v2" ) func test(t *testing.T, withContext bool) { diff --git a/debug/service/handler/debug.go b/debug/service/handler/debug.go index a6a4dbff..e66c8fb2 100644 --- a/debug/service/handler/debug.go +++ b/debug/service/handler/debug.go @@ -13,11 +13,11 @@ import ( ) // NewHandler returns an instance of the Debug Handler -func NewHandler(srv server.Server) *Debug { +func NewHandler() *Debug { return &Debug{ log: log.DefaultLog, stats: stats.DefaultStats, - trace: srv.Options().Tracer, + trace: trace.DefaultTracer, } } diff --git a/defaults.go b/defaults.go index 0159f19c..01854ff3 100644 --- a/defaults.go +++ b/defaults.go @@ -2,11 +2,13 @@ package micro import ( "github.com/micro/go-micro/client" + "github.com/micro/go-micro/debug/trace" "github.com/micro/go-micro/server" "github.com/micro/go-micro/store" // set defaults gcli "github.com/micro/go-micro/client/grpc" + memTrace "github.com/micro/go-micro/debug/trace/memory" gsrv "github.com/micro/go-micro/server/grpc" memStore "github.com/micro/go-micro/store/memory" ) @@ -18,4 +20,6 @@ func init() { server.DefaultServer = gsrv.NewServer() // default store store.DefaultStore = memStore.NewStore() + // set default trace + trace.DefaultTracer = memTrace.NewTracer() } diff --git a/web/service.go b/web/service.go index 46936b9c..c717e9e0 100644 --- a/web/service.go +++ b/web/service.go @@ -14,6 +14,7 @@ import ( "syscall" "time" + "github.com/micro/cli/v2" "github.com/micro/go-micro" "github.com/micro/go-micro/registry" maddr "github.com/micro/go-micro/util/addr" @@ -21,7 +22,6 @@ import ( "github.com/micro/go-micro/util/log" mnet "github.com/micro/go-micro/util/net" mls "github.com/micro/go-micro/util/tls" - "github.com/micro/cli/v2" ) type service struct {