mongo.NewClient does not return any error when providing invalid Mongo URI

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello,

       

       

      const (
           MONGO_URL = "mongodb://ASASASAS"
      )
      
      func main() {
           client, err := mongo.NewClient(options.Client().ApplyURI(MONGO_URL))
           if err != nil {
               log.Fatal(err)
           }
      }
      

      This code should return error, as I'm providing an invalid URI. But it is not returning any error, which is confusing.

       

            Assignee:
            Divjot Arora (Inactive)
            Reporter:
            cyan 3d
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: