From 4d62339be12570ad812f701444e89044348eb982 Mon Sep 17 00:00:00 2001 From: nsamokhin Date: Thu, 13 Jul 2023 13:55:12 +0300 Subject: [PATCH] Fix grpc gun startup bug quickfix --- components/grpc/import/import.go | 2 +- components/guns/grpc/core.go | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/components/grpc/import/import.go b/components/grpc/import/import.go index 57cc8276c..b624b44e5 100644 --- a/components/grpc/import/import.go +++ b/components/grpc/import/import.go @@ -19,5 +19,5 @@ func Import(fs afero.Fs) { return grpcjson.NewProvider(fs, conf) }) - register.Gun("grpc", grpc.NewGun, grpc.DefaultGunConfig()) + register.Gun("grpc", grpc.NewGun, grpc.DefaultGunConfig) } diff --git a/components/guns/grpc/core.go b/components/guns/grpc/core.go index d38e56faa..30f26f9b8 100644 --- a/components/guns/grpc/core.go +++ b/components/guns/grpc/core.go @@ -66,16 +66,14 @@ type Gun struct { answLog *zap.Logger } -func DefaultGunConfig() func() GunConfig { - return func() GunConfig { - return GunConfig{ - Target: "default target", - AnswLog: AnswLogConfig{ - Enabled: false, - Path: "answ.log", - Filter: "all", - }, - } +func DefaultGunConfig() GunConfig { + return GunConfig{ + Target: "default target", + AnswLog: AnswLogConfig{ + Enabled: false, + Path: "answ.log", + Filter: "all", + }, } }