Golang and MongoDb remote access fail (server returned error on SASL authentication step: Authentication failed.)
<p>I am trying to connect to remote MongoDB database (Mongolab) from Go with mgo library but getting error <code>panic: server returned error on SASL authentication step: Authentication failed</code>. Here is my code</p>

<pre><code>package main

import (
    "fmt"
    "gopkg.in/mgo.v2"
    "gopkg.in/mgo.v2/bson"
    "log"
)

type Person struct {
    Name  string
    Phone string
}

func main() {
    session, err := mgo.Dial("mongodb://&lt;dbusername&gt;:&lt;dbpassword&gt;@ds055855.mlab.com:55855")

    if err != nil {
        panic(err)
    }
    defer session.Close()

    // Optional. Switch the session to a monotonic behavior.
    session.SetMode(mgo.Monotonic, true)

    c := session.DB("catalog").C("History")
    err = c.Insert(&amp;Person{"Ale", "+55 53 8116 9639"},
        &amp;Person{"Cla", "+55 53 8402 8510"})
    if err != nil {
        log.Fatal(err)
    }

    result := Person{}
    err = c.Find(bson.M{"name": "Ale"}).One(&amp;result)
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println("Phone:", result.Phone)
}
</code></pre>

<p>How can I fix this? And of course instead of stars in my code i write my login and password.</p>