From 7ff519ae8cc28bebbd35c8b74b6b2706c75d66b6 Mon Sep 17 00:00:00 2001 From: Kissaki Date: Tue, 10 May 2011 16:57:36 +0200 Subject: [PATCH] example now allows passing of server to connect to as argument\nrm line ending space --- example.go | 3 ++- xmpp.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/example.go b/example.go index 73684d9..bca317d 100644 --- a/example.go +++ b/example.go @@ -10,6 +10,7 @@ import ( "strings" ) +var server = flag.String("server", "talk.google.com:443", "server") var username = flag.String("username", "", "username") var password = flag.String("password", "", "password") @@ -24,7 +25,7 @@ func main() { flag.Usage() } - talk, err := xmpp.NewClient("talk.google.com:443", *username, *password) + talk, err := xmpp.NewClient(*server, *username, *password) if err != nil { log.Fatal(err) } diff --git a/xmpp.go b/xmpp.go index b6dffe2..c1ae626 100644 --- a/xmpp.go +++ b/xmpp.go @@ -46,7 +46,7 @@ type Client struct { // NewClient creates a new connection to a host given as "hostname" or "hostname:port". // If host is not specified, the DNS SRV should be used to find the host from the domainpart of the JID. -// Default the port to 5222. +// Default the port to 5222. func NewClient(host, user, passwd string) (*Client, os.Error) { addr := host