Plugins: Optimize creation of Golang errors and slices (#69448)

* tidy up

* fix tests
This commit is contained in:
Will Browne
2023-06-07 17:22:43 +02:00
committed by GitHub
parent 8a8b5da1ee
commit 1fd4953833
13 changed files with 72 additions and 66 deletions
+1 -2
View File
@@ -180,8 +180,7 @@ func (f *FakePluginRegistry) Plugin(_ context.Context, id string) (*plugins.Plug
}
func (f *FakePluginRegistry) Plugins(_ context.Context) []*plugins.Plugin {
var res []*plugins.Plugin
res := make([]*plugins.Plugin, 0, len(f.Store))
for _, p := range f.Store {
res = append(res, p)
}