diff options
| author | Paul Buetow <paul@buetow.org> | 2021-09-18 19:27:50 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-02 12:26:29 +0300 |
| commit | abeac87aec44249bf67f1b0eca471a31086265ca (patch) | |
| tree | e4b054f009e8c572da9463ddfcbc7fddb45d22c5 /internal/done.go | |
| parent | 69b88a1cae0a61bd22530c384f40166b37b9f1ea (diff) | |
fix auto reconnect
Diffstat (limited to 'internal/done.go')
| -rw-r--r-- | internal/done.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/done.go b/internal/done.go index 54e5e8e..5ea22a0 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 |
