From 857ffe4fddecd21add747c3b567764d7f177cdef Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 17 Feb 2024 03:28:05 -0500 Subject: [PATCH] refactor: need to use a param struct to get protocol value group --- protocols/protocols.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/protocols/protocols.go b/protocols/protocols.go index 81b7d9f..36292cd 100644 --- a/protocols/protocols.go +++ b/protocols/protocols.go @@ -26,8 +26,12 @@ func BuildProtocols(config *viper.Viper) fx.Option { } } - options = append(options, fx.Invoke(func(protocols []registry.Protocol) error { - for _, protocol := range protocols { + type initParams struct { + Protocols []registry.Protocol `group:"protocol"` + } + + options = append(options, fx.Invoke(func(params initParams) error { + for _, protocol := range params.Protocols { err := protocol.Init() if err != nil { return err