package xmpp import ( "encoding/xml" "log" ) func (s *session) sendPresence() { start := xml.StartElement{ xml.Name{"", "presence"}, []xml.Attr{}, } end := start.End() tokens := [...]xml.Token{start, end} for _, v := range tokens { err := s.ed.encodeToken(v) if err != nil { log.Println("Could not encode presence!") return } } }