Closed CHTJonas closed 3 years ago
Nit: wrap errors using %w to allow the use of the errors.Is function. https://blog.golang.org/go1.13-errors
%w
errors.Is
Currently the returned error is only used internally and it simply gets logged if not nil:
nil
https://github.com/go-ping/ping/blob/22d47451d074c67c29d130af1ce96f45edb4e30d/ping.go#L399
However #16 wants to change this and return errors to the end user so this PR will invariably help when #16 is resolved.
Nit: wrap errors using
%w
to allow the use of theerrors.Is
function. https://blog.golang.org/go1.13-errorsCurrently the returned error is only used internally and it simply gets logged if not
nil
:https://github.com/go-ping/ping/blob/22d47451d074c67c29d130af1ce96f45edb4e30d/ping.go#L399
However #16 wants to change this and return errors to the end user so this PR will invariably help when #16 is resolved.