From d9cb4a14d31a90caceaa18fbe822e33b9a31ed0c Mon Sep 17 00:00:00 2001 From: Mario Trangoni Date: Sun, 1 Mar 2020 15:58:22 +0100 Subject: [PATCH] scrape/target_test.go: remove deprecated function BuildNameToCertificate() Related to https://github.com/golang/go/commit/eb93c684d40de4924fc0664d7d9e98a84d5a100b See, $ make lint >> running golangci-lint GO111MODULE=on go list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null GO111MODULE=on /home/mt/go/packages/bin/golangci-lint run ./... scrape/target_test.go:260:2: SA1019: tlsConfig.BuildNameToCertificate is deprecated: NameToCertificate only allows associating a single certificate with a given name. Leave that field nil to let the library select the first compatible chain from Certificates. (staticcheck) tlsConfig.BuildNameToCertificate() ^ scrape/target_test.go:357:2: SA1019: tlsConfig.BuildNameToCertificate is deprecated: NameToCertificate only allows associating a single certificate with a given name. Leave that field nil to let the library select the first compatible chain from Certificates. (staticcheck) tlsConfig.BuildNameToCertificate() ^ make: *** [Makefile.common:181: common-lint] Error 1 $ go version go version go1.14 linux/amd64 Signed-off-by: Mario Trangoni --- scrape/target_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/scrape/target_test.go b/scrape/target_test.go index 09a2035f0..fc9f6e81c 100644 --- a/scrape/target_test.go +++ b/scrape/target_test.go @@ -257,7 +257,6 @@ func TestNewHTTPClientCert(t *testing.T) { tlsConfig := newTLSConfig("server", t) tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert tlsConfig.ClientCAs = tlsConfig.RootCAs - tlsConfig.BuildNameToCertificate() server.TLS = tlsConfig server.StartTLS() defer server.Close() @@ -354,7 +353,6 @@ func newTLSConfig(certName string, t *testing.T) *tls.Config { t.Errorf("Unable to use specified server cert (%s) & key (%v): %s", certPath, keyPath, err) } tlsConfig.Certificates = []tls.Certificate{cert} - tlsConfig.BuildNameToCertificate() return tlsConfig }