linting fixes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2019-12-03 22:59:44 +03:00
parent 7d5bdcf993
commit a1eaf9cc20
41 changed files with 76 additions and 80 deletions

View File

@@ -195,6 +195,7 @@ func (r *runtime) Read(opts ...ReadOption) ([]*Service, error) {
return k == v
}
//nolint:prealloc
var services []*Service
for _, service := range r.services {
@@ -258,10 +259,11 @@ func (r *runtime) Delete(s *Service) error {
// List returns a slice of all services tracked by the runtime
func (r *runtime) List() ([]*Service, error) {
var services []*Service
r.RLock()
defer r.RUnlock()
services := make([]*Service, 0, len(r.services))
for _, service := range r.services {
services = append(services, service.Service)
}

View File

@@ -7,7 +7,7 @@ import (
"strings"
"github.com/micro/go-micro/runtime/source"
"gopkg.in/src-d/go-git.v4"
git "gopkg.in/src-d/go-git.v4"
)
// Source retrieves source code