From bd35627e012cc6307c8946067f86fe9789b6b813 Mon Sep 17 00:00:00 2001 From: Jozef Reisinger Date: Mon, 30 May 2022 16:08:07 +0200 Subject: [PATCH] Revert "add ExampleCheck" This reverts commit 4d47a045c481acfac0c70eaf808ccfd023fe074c. --- checkip_check_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/checkip_check_test.go b/checkip_check_test.go index 86a671b..022d79c 100644 --- a/checkip_check_test.go +++ b/checkip_check_test.go @@ -11,18 +11,21 @@ import ( // IsWellKnown implements checkip.Check. func IsWellKnown(ipaddr net.IP) (checkip.Result, error) { + res := checkip.Result{Name: "well known"} + wellKnown := []net.IP{ net.ParseIP("1.1.1.1"), net.ParseIP("4.4.4.4"), net.ParseIP("8.8.8.8"), } - var known WellKnown + for _, wk := range wellKnown { if string(ipaddr) == string(wk) { - known = true + res.Info = WellKnown(true) } } - return checkip.Result{Name: "well known", Info: known}, nil + + return res, nil } // WellKnown implements checkip.Info. @@ -42,10 +45,3 @@ func Example() { results.PrintSummary() // Output: well known true } - -func ExampleCheck() { - ipaddr := net.ParseIP("2.2.2.2") - result, _ := IsWellKnown(ipaddr) - fmt.Println(result) - // Output: {well known Info false false} -}