Docker Community Forums

Share and learn in the Docker community.

Possible doc bug for go client


(Rob Kielty) #1


In develop/sdk/ we have the following instruction under the heading Go SDK :

go get

But when I run this from the command line I get the following errors

$ go get
src/ undefined: http.ErrUseLastResponse
src/ transport.DialContext undefined (type *http.Transport has no field or method DialContext)
src/ dialer.DialContext undefined (type *net.Dialer has no field or method DialContext)
src/ undefined: "time".Until
src/ undefined: tlsConfigClone

Is this instruction correct in the docs or are these errors I see local to my setup?

Local setup

~/dev/orc$ go version
go version go1.6.2 linux/amd64

~/dev/orc$ docker --version
Docker version 17.12.1-ce, build 7390fc6

~/dev/orc$ echo $GOPATH 

$ uname -a
Linux my-machine-name 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

In the unlikely event that this is a doc bug am happy to submit a fix based on any info gathered here.

MT for any help provided :slight_smile:

(David Maze) #2

In Go time, that’s…really really old. (Even if it’s only 2 years old in calendar time.)

I don’t see a minimum Go version called out in any documentation I can easily find. Go 1.7’s big feature was adding "context", and transport.DialContext and dialer.DialContext almost certainly came along with that; http.ErrUseLastResponse is also a Go 1.7 feature; time.Until got added in Go 1.8. So it looks like Go 1.8 is the minimum.

In my experience Go has been pretty serious about their backwards compatibility guarantees and upgrading the Go toolchain version is pretty safe. For practical development you almost certainly want context in the standard library anyways and I’d encourage upgrading.

(Rob Kielty) #3

Cheers David, I’ll upgrade and report back.

(Rob Kielty) #4

I logged the following PR