moby--moby/registry
Sebastiaan van Stijn 382b986520
registry: make defaultService.ServiceConfig() more idiomatic
The intent of this function is to return a copy of the service's configuration,
and to copy / dereference the options in its configuration.

The code was doing this in slightly complicated fashion. This patch;

- adds a `copy()` function to serviceConfig
- rewrites the code to use a slightly more idiomatic approach, using one of
  the approaches described in "golang SliceTricks" https://github.com/golang/go/wiki/SliceTricks#copy
- changes defaultService.ServiceConfig() to use this function, and updates
  its godoc to better describe that it returns a copy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-17 17:12:27 +01:00
..
resumable
auth.go registry: minor improvements and cleanup 2022-03-17 17:12:21 +01:00
auth_test.go registry: remove unneeded alias for api/types/registry import 2022-03-17 17:12:19 +01:00
config.go registry: make defaultService.ServiceConfig() more idiomatic 2022-03-17 17:12:27 +01:00
config_test.go
config_unix.go
config_windows.go
endpoint_test.go
endpoint_v1.go registry: minor improvements and cleanup 2022-03-17 17:12:21 +01:00
errors.go
registry.go registry: defaultService: use sync.RWMutex 2022-03-17 17:12:23 +01:00
registry_mock_test.go registry: remove unneeded alias for api/types/registry import 2022-03-17 17:12:19 +01:00
registry_test.go registry: remove unneeded alias for api/types/registry import 2022-03-17 17:12:19 +01:00
service.go registry: make defaultService.ServiceConfig() more idiomatic 2022-03-17 17:12:27 +01:00
service_v2.go registry: defaultService: use sync.RWMutex 2022-03-17 17:12:23 +01:00
session.go registry: remove unneeded alias for api/types/registry import 2022-03-17 17:12:19 +01:00
types.go registry: remove unneeded alias for api/types/registry import 2022-03-17 17:12:19 +01:00