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) } }