From fe2d323c827c794c995cd1e3605e76c36a6f38f4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Dec 2023 13:02:37 +0100 Subject: [PATCH] registry: remove/rename err-returns, and minor refactor Signed-off-by: Sebastiaan van Stijn --- registry/service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/service.go b/registry/service.go index 3d87cfb478..ad85e839be 100644 --- a/registry/service.go +++ b/registry/service.go @@ -40,7 +40,7 @@ func (s *Service) ServiceConfig() *registry.ServiceConfig { // ReplaceConfig prepares a transaction which will atomically replace the // registry service's configuration when the returned commit function is called. -func (s *Service) ReplaceConfig(options ServiceOptions) (commit func(), err error) { +func (s *Service) ReplaceConfig(options ServiceOptions) (commit func(), _ error) { config, err := newServiceConfig(options) if err != nil { return nil, err @@ -148,7 +148,7 @@ type APIEndpoint struct { // LookupPullEndpoints creates a list of v2 endpoints to try to pull from, in order of preference. // It gives preference to mirrors over the actual registry, and HTTPS over plain HTTP. -func (s *Service) LookupPullEndpoints(hostname string) (endpoints []APIEndpoint, err error) { +func (s *Service) LookupPullEndpoints(hostname string) ([]APIEndpoint, error) { s.mu.RLock() defer s.mu.RUnlock() @@ -157,7 +157,7 @@ func (s *Service) LookupPullEndpoints(hostname string) (endpoints []APIEndpoint, // LookupPushEndpoints creates a list of v2 endpoints to try to push to, in order of preference. // It gives preference to HTTPS over plain HTTP. Mirrors are not included. -func (s *Service) LookupPushEndpoints(hostname string) (endpoints []APIEndpoint, err error) { +func (s *Service) LookupPushEndpoints(hostname string) ([]APIEndpoint, error) { s.mu.RLock() defer s.mu.RUnlock()