Skip to content

Commit

Permalink
Revert "add ExampleCheck"
Browse files Browse the repository at this point in the history
This reverts commit 4d47a04.
  • Loading branch information
jreisinger committed May 30, 2022
1 parent 4d47a04 commit bd35627
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions checkip_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
}

0 comments on commit bd35627

Please sign in to comment.