Closed tonistiigi closed 8 years ago
@tiborvass @aaronlehmann
So this will not work for Go1.6 and under, I guess it's fine. LGTM
Is this really how Clone
is implemented upstream? I know we don't care for our purposes, but I would expect a function called Clone
to make a deep copy of slices and maps inside the struct. Otherwise changes to the slice or map in the original object will affect the clone, or vice versa.
@tiborvass I can make a go1.6 function as well if you think it's important. We can't reuse the same function though because new keys were added.
@aaronlehmann https://github.com/golang/go/commit/d24f446a90ea94b87591bf16228d7d871fec3d92 https://github.com/golang/go/commit/db5802104797cadcb4f44c5198a0fc39e13f9bc3
Fair enough: Clone returns a shallow clone of c.
LGTM
govet detected a case where we copy tls.Config although the var contains mutexes. This is fixed in go1.8 with a stdlib Clone method. Temporarily add a local copy of that function until we can move to go1.8
Signed-off-by: Tonis Tiigi tonistiigi@gmail.com