From: SuperQ Date: Sat, 22 Jan 2022 17:18:46 +0000 (+0100) Subject: Fixup chooseProtocol test. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=12de3f0bb4bea723b1d8cfb86a4c087532a30f1b;p=blackbox_exporter.git Fixup chooseProtocol test. Verified this works all the way back to Go 1.13. Signed-off-by: SuperQ --- 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")