More trivial connection crap

This commit is contained in:
Dan Buch 2012-11-06 23:58:51 -05:00
parent 2f527a9d80
commit 97c9a95968

View File

@ -2,7 +2,7 @@ package main
import ( import (
"flag" "flag"
"fmt" "log"
) )
import ( import (
@ -18,6 +18,23 @@ func main() {
flag.Parse() flag.Parse()
conn, err := amqp.Dial(*connUri) conn, err := amqp.Dial(*connUri)
fmt.Println("conn=%+v", conn) defer conn.Close()
fmt.Println("err=%+v", err)
if err != nil {
log.Fatal("err:", err)
}
if conn != nil {
log.Println("conn:", conn)
}
channel, err := conn.Channel()
if err != nil {
log.Fatal("err:", err)
}
if channel != nil {
log.Println("channel:", channel)
}
} }