diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-10-21 21:28:49 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-10-21 21:28:49 +0300 |
| commit | f4207a55f71bfbcfdc532d5cdd3befaa3474a157 (patch) | |
| tree | ea5e4a2d2a67035f645bdee496ae55a52034178a /internal/done.go | |
| parent | d80d6070557e3a800e3a54967af9eced518f116b (diff) | |
| parent | 739205206d63bf42f4e843b39d04d4c8cd8207c3 (diff) | |
merge develop
Diffstat (limited to 'internal/done.go')
| -rw-r--r-- | internal/done.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/done.go b/internal/done.go index 54e5e8e..94f9289 100644 --- a/internal/done.go +++ b/internal/done.go @@ -17,6 +17,15 @@ func NewDone() *Done { } } +func (d *Done) String() string { + select { + case <-d.Done(): + return "Done(yes)" + default: + return "Done(no)" + } +} + // Done returns the done channel (closed when done) func (d *Done) Done() <-chan struct{} { return d.ch @@ -26,7 +35,6 @@ func (d *Done) Done() <-chan struct{} { func (d *Done) Shutdown() { d.mutex.Lock() defer d.mutex.Unlock() - select { case <-d.ch: return |
