From 12de3f0bb4bea723b1d8cfb86a4c087532a30f1b Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sat, 22 Jan 2022 18:18:46 +0100 Subject: [PATCH] Fixup chooseProtocol test. Verified this works all the way back to Go 1.13. Signed-off-by: SuperQ --- prober/utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prober/utils_test.go b/prober/utils_test.go index ed56baf..def607a 100644 --- a/prober/utils_test.go +++ b/prober/utils_test.go @@ -162,7 +162,7 @@ func TestChooseProtocol(t *testing.T) { registry = prometheus.NewPedanticRegistry() ip, _, err = chooseProtocol(ctx, "ip4", false, "ipv6.google.com", registry, logger) - if err != nil && err.Error() != "address ipv6.google.com: no suitable address found" { + if err != nil && !err.(*net.DNSError).IsNotFound { t.Error(err) } else if err == nil { t.Error("should set error") -- 2.25.1