Skip to content

Commit

Permalink
Improve handling of errors returned by go-ping library
Browse files Browse the repository at this point in the history
  • Loading branch information
CHTJonas committed Mar 13, 2021
1 parent e584031 commit 9f8d565
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/hosts/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ func (e *Endpoint) Ping(count int) (*ping.Statistics, error) {
pinger.Size = 56
pinger.Interval = time.Second
pinger.Timeout = time.Second * 10
pinger.Run() // blocks until finished
err = pinger.Run() // blocks until finished
if err != nil {
return nil, err
}
return pinger.Statistics(), nil
}

Expand Down

0 comments on commit 9f8d565

Please sign in to comment.