docker / engine-api

DEPRECATED: Please see https://github.com/docker/docker/tree/master/client
Apache License 2.0
264 stars 163 forks source link

Fix CI for go1.7 #382

Closed tonistiigi closed 8 years ago

tonistiigi commented 8 years ago

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

tonistiigi commented 8 years ago

@tiborvass @aaronlehmann

tiborvass commented 8 years ago

So this will not work for Go1.6 and under, I guess it's fine. LGTM

aaronlehmann commented 8 years ago

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.

tonistiigi commented 8 years ago

@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

aaronlehmann commented 8 years ago

Fair enough: Clone returns a shallow clone of c.

aaronlehmann commented 8 years ago

LGTM