fix char ls bugs

This commit is contained in:
Kasper Juul Hermansen 2022-11-02 20:30:44 +01:00
parent bace568ad5
commit e59a87c43a
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
4 changed files with 7 additions and 5 deletions

Binary file not shown.

View File

@ -11,3 +11,5 @@ type About struct {
type Plugin interface { type Plugin interface {
About(ctx context.Context) (*About, error) About(ctx context.Context) (*About, error)
} }
const PluginKey = "plugin"

View File

@ -20,7 +20,7 @@ func NewPluginBuilder(p Plugin) *PluginBuilder {
}) })
var pluginMap = map[string]plugin.Plugin{ var pluginMap = map[string]plugin.Plugin{
"plugin": &PluginAPI{ PluginKey: &PluginAPI{
Impl: p, Impl: p,
}, },
} }

View File

@ -91,7 +91,7 @@ func (pr *PluginRegisterBuilder) Build(ctx context.Context) (*PluginRegister, er
), ),
), ),
Plugins: map[string]plugin.Plugin{ Plugins: map[string]plugin.Plugin{
name: &p, PluginKey: &p,
}, },
}) })
@ -175,8 +175,8 @@ func (pr *PluginRegister) About(ctx context.Context) ([]AboutItem, error) {
errgroup, ctx := errgroup.WithContext(ctx) errgroup, ctx := errgroup.WithContext(ctx)
for n, c := range pr.clients { for _, c := range pr.clients {
n, c := n, c c := c
errgroup.Go(func() error { errgroup.Go(func() error {
about, err := c.plugin.About(ctx) about, err := c.plugin.About(ctx)
if err != nil { if err != nil {
@ -184,7 +184,7 @@ func (pr *PluginRegister) About(ctx context.Context) ([]AboutItem, error) {
} }
list = append(list, AboutItem{ list = append(list, AboutItem{
Name: n, Name: about.Name,
Version: about.Version, Version: about.Version,
About: about.About, About: about.About,
}) })