mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Ensure data-race-free access to the daemon configuration without locking by mutating a deep copy of the config and atomically storing a pointer to the copy into the daemon-wide configStore value. Any operations which need to read from the daemon config must capture the configStore value only once and pass it around to guarantee a consistent view of the config. Signed-off-by: Cory Snider <csnider@mirantis.com>
508 B
508 B
copystructure
copystructure is a Go library for deep copying values in Go.
This allows you to copy Go values that may contain reference values such as maps, slices, or pointers, and copy their data as well instead of just their references.
Installation
Standard go get:
$ go get github.com/mitchellh/copystructure
Usage & Example
For usage and examples see the Godoc.
The Copy function has examples associated with it there.