From f3a5057968d127ac89635f0cb733804f4361d27a Mon Sep 17 00:00:00 2001 From: Pontus Leitzler Date: Mon, 14 Nov 2016 17:16:38 +0000 Subject: [PATCH] Fix SA2003, deferred Lock right after locking --- pkg/registry/registrytest/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/registrytest/service.go b/pkg/registry/registrytest/service.go index b06d1e76ef9..89ca649122b 100644 --- a/pkg/registry/registrytest/service.go +++ b/pkg/registry/registrytest/service.go @@ -121,7 +121,7 @@ func (r *ServiceRegistry) WatchServices(ctx api.Context, options *api.ListOption func (r *ServiceRegistry) ExportService(ctx api.Context, name string, options unversioned.ExportOptions) (*api.Service, error) { r.mu.Lock() - defer r.mu.Lock() + defer r.mu.Unlock() return r.Service, r.Err }