diff options
author | xengineering <me@xengineering.eu> | 2023-05-11 20:44:18 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-11 20:44:18 +0200 |
commit | 1c054d8f976f3f2330aaa31bf72c4584be7e35a4 (patch) | |
tree | 99bb15bf5fdc8f8be9a5f2ec390f5e70a898585b | |
parent | 03c43e5db20d4c4613ec56ee1ec4c4255398d630 (diff) | |
download | limox-1c054d8f976f3f2330aaa31bf72c4584be7e35a4.tar limox-1c054d8f976f3f2330aaa31bf72c4584be7e35a4.tar.zst limox-1c054d8f976f3f2330aaa31bf72c4584be7e35a4.zip |
Further refactoring with the defer statement
-rw-r--r-- | xmpp.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -28,6 +28,7 @@ func (l *Limox) xmpp(jid string, pwd string) { receiver := make(chan xml.Token) termination := make(chan bool) go rxRoutine(conn, receiver, termination) + defer func() { termination <- true }() enc := xml.NewEncoder(conn) dbg := xml.NewEncoder(os.Stdout) @@ -42,7 +43,6 @@ func (l *Limox) xmpp(jid string, pwd string) { case ev := <-l.GuiEvents: switch ev { case Disconnect: - termination <- true return default: log.Fatalf("Unknown GuiEvent '%d'!\n", ev) |