Commit Graph

6 Commits

Author SHA1 Message Date
Lifei Chen
e8ae07c3ce
Return an error when addr is empty 2020-09-18 13:04:29 +01:00
Ben Kochie
8e89829cd5
Don't resolve when creating Pinger (#65)
Move the DNS resolver out of the NewPinger() function in order to allow
adjusting of IPv4 vs IPv6 DNS resolution before running. This also
allows the user to verify resolution.
* Create new `New()` method that returns a bare default struct.
* Create new `Resolve()` method.
* Call `Resolve()` from `SetAddr()`.
* Call `Resolve()` automatically from `Run()`.
* Remove unecessary private `run()` method.

Update ping command for simplifed return values of `NewPinger()`.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-09-14 07:41:27 +02:00
Cam
e33cfb8ae7 Add processPacket unit tests
Add vet and unit test to circleci job
2019-06-04 11:15:55 -07:00
Greg
56df11e077 Make processPacket more performant (#59)
* Make processPacket more performant

* Add more info for debugging to returned error

* remove old benchmark

* change print statement to error return
2019-06-03 16:11:21 -07:00
Cameron Sparr
416e72114c Add integration tests in circle 2016-02-08 09:29:08 -07:00
Cameron Sparr
dae25ab260 Write unit tests 2016-02-07 14:15:39 -07:00