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 {
|
||||
About(ctx context.Context) (*About, error)
|
||||
}
|
||||
|
||||
const PluginKey = "plugin"
|
||||
|
@ -20,7 +20,7 @@ func NewPluginBuilder(p Plugin) *PluginBuilder {
|
||||
})
|
||||
|
||||
var pluginMap = map[string]plugin.Plugin{
|
||||
"plugin": &PluginAPI{
|
||||
PluginKey: &PluginAPI{
|
||||
Impl: p,
|
||||
},
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ func (pr *PluginRegisterBuilder) Build(ctx context.Context) (*PluginRegister, er
|
||||
),
|
||||
),
|
||||
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)
|
||||
|
||||
for n, c := range pr.clients {
|
||||
n, c := n, c
|
||||
for _, c := range pr.clients {
|
||||
c := c
|
||||
errgroup.Go(func() error {
|
||||
about, err := c.plugin.About(ctx)
|
||||
if err != nil {
|
||||
@ -184,7 +184,7 @@ func (pr *PluginRegister) About(ctx context.Context) ([]AboutItem, error) {
|
||||
}
|
||||
|
||||
list = append(list, AboutItem{
|
||||
Name: n,
|
||||
Name: about.Name,
|
||||
Version: about.Version,
|
||||
About: about.About,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user