1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

preallocated slices (#917)

This commit is contained in:
Till Knuesting
2019-11-05 17:43:12 +00:00
committed by Asim Aslam
parent 4a694c9d02
commit f67c5e779f
10 changed files with 10 additions and 10 deletions

View File

@ -139,7 +139,7 @@ func (k *kubernetes) Update(s *runtime.Service) error {
func (k *kubernetes) List() ([]*runtime.Service, error) {
// TODO: this should list the k8s deployments
// but for now we return in-memory tracked services
var services []*runtime.Service
services := make([]*runtime.Service, 0, len(k.services))
k.RLock()
defer k.RUnlock()