Skip to content

Commit

Permalink
minor changes in cli/cli.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Reisinger committed Nov 20, 2021
1 parent a1b5b13 commit 56782e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/jreisinger/checkip/check"
)

// Run runs checks concurrently against the ippaddr.
func Run(checks []check.Check, ipaddr net.IP) (Results, []error) {
var results Results
var errors []error
Expand All @@ -25,7 +26,6 @@ func Run(checks []check.Check, ipaddr net.IP) (Results, []error) {
r, err := c(ipaddr)
if err != nil {
errors = append(errors, err)
// log.Printf("check failed: %v", err)
return
}
results = append(results, r)
Expand All @@ -37,6 +37,7 @@ func Run(checks []check.Check, ipaddr net.IP) (Results, []error) {

type Results []check.Result

// PrintJSON prints all results in JSON.
func (rs Results) PrintJSON() {
if len(rs) == 0 {
return
Expand All @@ -58,7 +59,7 @@ func (rs Results) SortByName() {
})
}

// PrintInfo prints results from Info and InfoSec checkers.
// PrintInfo prints summary results from Info and InfoSec checkers.
func (rs Results) PrintInfo() {
for _, r := range rs {
if r.Type == check.TypeInfo || r.Type == check.TypeInfoSec {
Expand Down

0 comments on commit 56782e7

Please sign in to comment.