Skip to content

Commit

Permalink
add missing defer close for RunWithTimeout (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
emar-kar authored Jun 8, 2024
1 parent e279609 commit 746577b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/utils/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func RunWithTimeout(f func() error, timeout time.Duration) error {
done := make(chan error, 1)

go func() {
defer close(done)

done <- f()
}()

Expand Down

0 comments on commit 746577b

Please sign in to comment.