From e34aa4134e26470f77178b87c2afae11905de0bf Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 5 Nov 2022 23:09:16 +0100 Subject: [PATCH] with normal string gob --- pkg/charcontext/char_context.go | 3 +-- pkg/register/plugin_register.go | 4 ++++ pkg/register/plugin_server.go | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/charcontext/char_context.go b/pkg/charcontext/char_context.go index 2d6dc84..870ff1c 100644 --- a/pkg/charcontext/char_context.go +++ b/pkg/charcontext/char_context.go @@ -66,6 +66,5 @@ func (cc *CharContext) About(ctx context.Context) ([]register.AboutItem, error) } func (cc *CharContext) Do(ctx context.Context, clientName string, commandName string, args map[string]string) error { - cc.pluginRegister.Do(ctx, clientName, commandName, args) - return nil + return cc.pluginRegister.Do(ctx, clientName, commandName, args) } diff --git a/pkg/register/plugin_register.go b/pkg/register/plugin_register.go index 14d9fcf..705c565 100644 --- a/pkg/register/plugin_register.go +++ b/pkg/register/plugin_register.go @@ -237,5 +237,9 @@ func (pr *PluginRegister) Do(ctx context.Context, clientName string, commandName return client.plugin.Do(ctx, commandName, args) }) + if err := errgroup.Wait(); err != nil { + return err + } + return nil } diff --git a/pkg/register/plugin_server.go b/pkg/register/plugin_server.go index 98749c5..0e7a630 100644 --- a/pkg/register/plugin_server.go +++ b/pkg/register/plugin_server.go @@ -9,9 +9,9 @@ type PluginServer struct { Impl Plugin } -func (ps *PluginServer) Do(args *string, resp *string) error { +func (ps *PluginServer) Do(args string, resp *string) error { var doReq DoRequest - if err := json.Unmarshal([]byte(*args), &doReq); err != nil { + if err := json.Unmarshal([]byte(args), &doReq); err != nil { return err }