docker / engine-api

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

c.Clone undefined (type *tls.Config has no field or method Clone) #385

Closed zanhsieh closed 8 years ago

zanhsieh commented 8 years ago

Hi,

I ran the sample code provided on README.md of this repo, and got this error:

# github.com/docker/engine-api/client/transport
../docker/engine-api/client/transport/tlsconfig_clone.go:10: c.Clone undefined (type *tls.Config has no field or method Clone)
error: failed to run go: exit status 2

My environment:

$ docker version
Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:15:28 2016
 OS/Arch:      linux/amd64

$ go version
go version go1.6.2 darwin/amd64

Did I do something wrong?

UPDATE: v0.4.0 seems fine without this issue.

zaunerc commented 8 years ago

Same here when trying to go get the engine-api to use it in one of my Go programs:

alpine34:~/gowork/src/github.com/zaunerc/cntinsight$ go version
go version go1.6.3 linux/amd64
alpine34:~/gowork/src/github.com/zaunerc/cntinsight$ go get
# github.com/docker/engine-api/client/transport
../../docker/engine-api/client/transport/tlsconfig_clone.go:10: c.Clone undefined (type *tls.Config has no field or method Clone)
alpine34:~/gowork/src/github.com/zaunerc/cntinsight$
vdemeester commented 8 years ago

@zaunerc hum this feels weird, I cannot reproduce it on a clean environment

$ go version
go version go1.6.3 linux/amd64
$ go get github.com/docker/engine-api
$ 

Tried it on 1.6.2, 1.6.3 too…

zaunerc commented 8 years ago

I have run some further tests. When compiling docker/engine-api using the current master (611c63f5121770f6d0db2f9988458310ccbfbe74) I can reproduce the problem.

When compiling using the release/1.12 branch docker/engine-api compiles just fine.

Maybe this has something to do with my development environment:

I will try to reproduce this problem using the following Docker images:

tonistiigi commented 8 years ago

https://github.com/docker/engine-api/pull/382#issuecomment-244512952 made go1.7 only supported version. It is not hard to write a hack for this case for go1.6 as well but I'm not sure if we want to maintain support for multiple go versions.

zanhsieh commented 8 years ago

Verified issue no longer existed. Close it for now.