1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
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 refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
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 registry: return "errdefs" compatible error types 2022-03-17 17:12:13 +01:00
config_unix.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
config_windows.go registry: fix mtls config dir passing 2020-05-14 12:02:09 -07:00
endpoint_test.go registry: un-export V1Endpoint and NewV1Endpoint() 2022-03-17 17:09:00 +01:00
endpoint_v1.go registry: minor improvements and cleanup 2022-03-17 17:12:21 +01:00
errors.go registry: return "errdefs" compatible error types 2022-03-17 17:12:13 +01:00
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