diff options
author | Ruben Pollan <meskio@sindominio.net> | 2019-10-29 19:13:32 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-11-04 17:48:00 +0100 |
commit | 237f4c77263dc3111d78da762459fe2315f8a0c3 (patch) | |
tree | d24ba82ab825e9094999216b2d8eec9ddf05de8c | |
parent | 85d3e8ac43e2493b5de3cc195ee6ab3da6c67bae (diff) |
Close the channel when listener close fails
- Resolves: #3
-rw-r--r-- | shapeshifter.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shapeshifter.go b/shapeshifter.go index f201e07..671ef90 100644 --- a/shapeshifter.go +++ b/shapeshifter.go @@ -43,13 +43,14 @@ func (ss *ShapeShifter) Open() error { } func (ss *ShapeShifter) Close() error { + var err error if ss.ln != nil { - return ss.ln.Close() + err = ss.ln.Close() } if ss.errChan != nil { close(ss.errChan) } - return nil + return err } func (ss *ShapeShifter) GetErrorChannel() chan error { |