Skip to content

Commit

Permalink
fixed lint errors...
Browse files Browse the repository at this point in the history
  • Loading branch information
eranharel committed Aug 20, 2019
1 parent 65397d2 commit cd691e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion checks/ping.go
Expand Up @@ -31,7 +31,8 @@ func NewPingCheck(name string, pinger Pinger, timeout time.Duration) (Check, err
return &CustomCheck{
CheckName: name,
CheckFunc: func() (details interface{}, err error) {
pingCtx, _ := context.WithTimeout(context.Background(), timeout)
pingCtx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
return nil, pinger.PingContext(pingCtx)
},
}, nil
Expand Down
3 changes: 2 additions & 1 deletion checks/ping_test.go
Expand Up @@ -54,7 +54,8 @@ func TestNewDialPinger(t *testing.T) {

pinger := NewDialPinger("tcp", "there.should.be.no.such.host.com:666")

ctx, _ := context.WithTimeout(context.Background(), time.Second*2)
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
defer cancel()
assertions.Error(pinger.PingContext(ctx), "expecting a ping error for non existing address")

pinger = NewDialPinger("tcp", "example.com:80")
Expand Down

0 comments on commit cd691e5

Please sign in to comment.