From c98a6ed79f41d407a86151a4c49ad0063a4aca9e Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Sun, 10 Mar 2024 22:23:17 +0900 Subject: [PATCH] Update variable name from Certificate to Certificates --- certificate.go | 6 +++--- certificate_test.go | 2 +- internal/config/config.go | 2 +- v2/certificate.go | 6 +++--- v2/certificate_test.go | 2 +- v2/internal/config/config.go | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/certificate.go b/certificate.go index acde889..5202f22 100644 --- a/certificate.go +++ b/certificate.go @@ -10,19 +10,19 @@ import ( "github.com/go-sql-driver/mysql" ) -// Certificate is the certificates for connecting RDS MySQL with SSL/TLS. +// Certificates is the certificates for connecting RDS MySQL with SSL/TLS. // It contains the intermediate and root certificates for [Amazon RDS MySQL] and [Amazon Aurora MySQL]. // // [Amazon RDS MySQL]: https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html // [Amazon Aurora MySQL]: https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html -const Certificate = rdsCertificates +const Certificates = rdsCertificates // TLSConfig is the tls.TLSConfig for connecting RDS MySQL with SSL/TLS. var TLSConfig *tls.Config func init() { rootCertPool := x509.NewCertPool() - if ok := rootCertPool.AppendCertsFromPEM([]byte(Certificate)); !ok { + if ok := rootCertPool.AppendCertsFromPEM([]byte(Certificates)); !ok { panic(errors.New("failed to append certs")) } TLSConfig = &tls.Config{ diff --git a/certificate_test.go b/certificate_test.go index 6c29400..6f3c499 100644 --- a/certificate_test.go +++ b/certificate_test.go @@ -9,7 +9,7 @@ import ( func TestCertificate(t *testing.T) { t.Parallel() - pemCerts := []byte(Certificate) + pemCerts := []byte(Certificates) for len(pemCerts) > 0 { var block *pem.Block block, pemCerts = pem.Decode(pemCerts) diff --git a/internal/config/config.go b/internal/config/config.go index 6f926a5..b61e66b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -41,7 +41,7 @@ enable-cleartext-plugin if err := os.WriteFile(fmt.Sprintf("%s.%d", confpath, now.UnixNano()), []byte(conf), 0600); err != nil { return err } - if err := os.WriteFile(fmt.Sprintf("%s.%d", pempath, now.UnixNano()), []byte(rdsmysql.Certificate), 0600); err != nil { + if err := os.WriteFile(fmt.Sprintf("%s.%d", pempath, now.UnixNano()), []byte(rdsmysql.Certificates), 0600); err != nil { return err } diff --git a/v2/certificate.go b/v2/certificate.go index acde889..5202f22 100644 --- a/v2/certificate.go +++ b/v2/certificate.go @@ -10,19 +10,19 @@ import ( "github.com/go-sql-driver/mysql" ) -// Certificate is the certificates for connecting RDS MySQL with SSL/TLS. +// Certificates is the certificates for connecting RDS MySQL with SSL/TLS. // It contains the intermediate and root certificates for [Amazon RDS MySQL] and [Amazon Aurora MySQL]. // // [Amazon RDS MySQL]: https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html // [Amazon Aurora MySQL]: https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL.html -const Certificate = rdsCertificates +const Certificates = rdsCertificates // TLSConfig is the tls.TLSConfig for connecting RDS MySQL with SSL/TLS. var TLSConfig *tls.Config func init() { rootCertPool := x509.NewCertPool() - if ok := rootCertPool.AppendCertsFromPEM([]byte(Certificate)); !ok { + if ok := rootCertPool.AppendCertsFromPEM([]byte(Certificates)); !ok { panic(errors.New("failed to append certs")) } TLSConfig = &tls.Config{ diff --git a/v2/certificate_test.go b/v2/certificate_test.go index 6c29400..6f3c499 100644 --- a/v2/certificate_test.go +++ b/v2/certificate_test.go @@ -9,7 +9,7 @@ import ( func TestCertificate(t *testing.T) { t.Parallel() - pemCerts := []byte(Certificate) + pemCerts := []byte(Certificates) for len(pemCerts) > 0 { var block *pem.Block block, pemCerts = pem.Decode(pemCerts) diff --git a/v2/internal/config/config.go b/v2/internal/config/config.go index cc207eb..e4ff375 100644 --- a/v2/internal/config/config.go +++ b/v2/internal/config/config.go @@ -40,7 +40,7 @@ enable-cleartext-plugin if err := os.WriteFile(fmt.Sprintf("%s.%d", confpath, now.UnixNano()), []byte(conf), 0600); err != nil { return err } - if err := os.WriteFile(fmt.Sprintf("%s.%d", pempath, now.UnixNano()), []byte(rdsmysql.Certificate), 0600); err != nil { + if err := os.WriteFile(fmt.Sprintf("%s.%d", pempath, now.UnixNano()), []byte(rdsmysql.Certificates), 0600); err != nil { return err }