Fixup vendored engine-api for go 1.5

Fix builds against go 1.5.  This should be temporary, since code we
vendor which depends on engine-api should be moving to something else.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai
2017-02-06 14:38:56 -05:00
parent c2305273eb
commit 084b9e4694
2 changed files with 32 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
// +build !go1.7
// +build go1.6,!go1.7
package transport

View File

@@ -0,0 +1,31 @@
// +build !go1.6
package transport
import "crypto/tls"
// TLSConfigClone returns a clone of tls.Config. This function is provided for
// compatibility for go1.5 that doesn't include this method in stdlib.
func TLSConfigClone(c *tls.Config) *tls.Config {
return &tls.Config{
Rand: c.Rand,
Time: c.Time,
Certificates: c.Certificates,
NameToCertificate: c.NameToCertificate,
GetCertificate: c.GetCertificate,
RootCAs: c.RootCAs,
NextProtos: c.NextProtos,
ServerName: c.ServerName,
ClientAuth: c.ClientAuth,
ClientCAs: c.ClientCAs,
InsecureSkipVerify: c.InsecureSkipVerify,
CipherSuites: c.CipherSuites,
PreferServerCipherSuites: c.PreferServerCipherSuites,
SessionTicketsDisabled: c.SessionTicketsDisabled,
SessionTicketKey: c.SessionTicketKey,
ClientSessionCache: c.ClientSessionCache,
MinVersion: c.MinVersion,
MaxVersion: c.MaxVersion,
CurvePreferences: c.CurvePreferences,
}
}