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 -1
View File
@@ -33,7 +33,7 @@ func (i *InMemory) Plugins(_ context.Context) []*plugins.Plugin {
i.mu.RLock()
defer i.mu.RUnlock()
res := make([]*plugins.Plugin, 0)
res := make([]*plugins.Plugin, 0, len(i.store))
for _, p := range i.store {
res = append(res, p)
}