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 }