fix char ls bugs
This commit is contained in:
parent
bace568ad5
commit
e59a87c43a
Binary file not shown.
@ -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"
|
||||||
|
@ -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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user