// RunWithContext runs the pinger with a context. This is a blocking function that will exit when it's
// done or if the context is canceled. If Count or Interval are not specified, it will run continuously until
// it is interrupted.
func (p *Pinger) RunWithContext(ctx context.Context) error {
...
if p.ipaddr == nil {
err = p.Resolve()
}
...
return p.run(ctx, conn)
}
function RunWithContext didn't exit as expected as it will block in p.Resolve(), it didn't exit even when ctx is canceled before it was passed in
function
RunWithContext
didn't exit as expected as it will block inp.Resolve()
, it didn't exit even when ctx is canceled before it was passed in