Skip to content

Commit 6e1e05f

Browse files
dprotasoRebecca Chin
authored and
Rebecca Chin
committed
Added cloneTLSConfig variant for go1.7
Resolves go vet warning for copying structs in sync package Signed-off-by: Rebecca Chin <rchin@pivotal.io>
1 parent 7187728 commit 6e1e05f

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

utils_go17.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// +build go1.7
2+
// +build !go1.8
3+
4+
package mysql
5+
6+
import "crypto/tls"
7+
8+
func cloneTLSConfig(c *tls.Config) *tls.Config {
9+
return &tls.Config{
10+
Rand: c.Rand,
11+
Time: c.Time,
12+
Certificates: c.Certificates,
13+
NameToCertificate: c.NameToCertificate,
14+
GetCertificate: c.GetCertificate,
15+
RootCAs: c.RootCAs,
16+
NextProtos: c.NextProtos,
17+
ServerName: c.ServerName,
18+
ClientAuth: c.ClientAuth,
19+
ClientCAs: c.ClientCAs,
20+
InsecureSkipVerify: c.InsecureSkipVerify,
21+
CipherSuites: c.CipherSuites,
22+
PreferServerCipherSuites: c.PreferServerCipherSuites,
23+
SessionTicketsDisabled: c.SessionTicketsDisabled,
24+
SessionTicketKey: c.SessionTicketKey,
25+
ClientSessionCache: c.ClientSessionCache,
26+
MinVersion: c.MinVersion,
27+
MaxVersion: c.MaxVersion,
28+
CurvePreferences: c.CurvePreferences,
29+
DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
30+
Renegotiation: c.Renegotiation,
31+
}
32+
}

utils_legacy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !go1.8
1+
// +build !go1.7
22

33
package mysql
44

0 commit comments

Comments
 (0)