box-o-sand/sylvilagus/src/meatballhat.com/sylvilagus-conntest/main.go
Dan Buch 2cb4181460 Renaming dumb little executable for clarity
plus I think I'll be using the `sylvilagus` package for library bits.
2012-11-11 09:42:18 -05:00

41 lines
519 B
Go

package main
import (
"flag"
"log"
)
import (
"github.com/streadway/amqp"
)
var (
connUri = flag.String("connuri", "amqp://guest:guest@localhost:5672",
"Connection URI for AMQP thingy")
)
func main() {
flag.Parse()
conn, err := amqp.Dial(*connUri)
defer conn.Close()
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)
}
}