<span class="hljs-keyword">func</span> main() {
        conn, err := amqp.Dial(<span class="hljs-string">&quot;amqp://guest:guest@localhost:5672/&quot;</span>)
        failOnError(err, <span class="hljs-string">&quot;Failed to connect to RabbitMQ&quot;</span>)
        <span class="hljs-keyword">defer</span> conn.Close()

        ch, err := conn.Channel()
        failOnError(err, <span class="hljs-string">&quot;Failed to open a channel&quot;</span>)
        <span class="hljs-keyword">defer</span> ch.Close()
