From 7fa564f8223a4de96ebd9f6d4e68da44d62201b2 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Wed, 13 May 2020 23:28:09 +0100 Subject: [PATCH] smtpsrv: Add comment on BuildNameToCertificate being deprecated tls.Config.BuildNameToCertificate was deprecated in Go 1.14, and is no longer necessary. However, we support down to 1.11, so we will keep it for now. This patch adds a TODO to remove it in the future once the minimum supported version is 1.14; and adjust the CI linter accordingly. --- .cirrus.yml | 4 +++- internal/smtpsrv/server.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6a873da..12f6746 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -53,7 +53,9 @@ lint_task: - errcheck - linters: - staticcheck - text: "SA1015:" + # SA1015: time.Tick leaks but it's ok on endless functions. + # SA1019: BuildNameToCertificate deprecation, remove on Go >= 1.14. + text: "SA1015:|SA1019:" exclude-use-default: true lint_config_file: path: /tmp/lint.yml diff --git a/internal/smtpsrv/server.go b/internal/smtpsrv/server.go index b688ff1..bd66140 100644 --- a/internal/smtpsrv/server.go +++ b/internal/smtpsrv/server.go @@ -202,6 +202,8 @@ func (s *Server) ListenAndServe() { // At this point the TLS config should be done, build the // name->certificate map (used by the TLS library for SNI). + // TODO: Once we support only Go >= 1.14, we can drop this, as it is no + // longer necessary. s.tlsConfig.BuildNameToCertificate() go s.periodicallyReload()