diff options
Diffstat (limited to 'xmpp/session.go')
-rw-r--r-- | xmpp/session.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmpp/session.go b/xmpp/session.go index e928f01..9959c80 100644 --- a/xmpp/session.go +++ b/xmpp/session.go @@ -3,8 +3,8 @@ package xmpp import ( "crypto/tls" "crypto/x509" - "log" "encoding/xml" + "log" ) type SessionConnect struct{} @@ -37,7 +37,9 @@ func (s *session) run() { defer func() { s.out <- SessionDisconnect{} }() err := s.startTransport() - if err != nil { return } + if err != nil { + return + } defer s.transport.Close() s.ed = newEncoderDecoder(s) @@ -53,8 +55,10 @@ func (s *session) run() { select { case data := <-s.in: switch data.(type) { - case SessionShouldDisconnect: return - default: log.Printf("Unknown data '%d'!\n", data) + case SessionShouldDisconnect: + return + default: + log.Printf("Unknown data '%d'!\n", data) } case _ = <-s.rx: // TODO route received XML token here |