Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13739

Go driver getting started instructions do not work

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: drivers
    • Labels:
    • 2


      page: https://docs.mongodb.com/drivers/go/

      The example to connect to Atlas is not possible to get working, users receive a code error:

      ./goproj.go:14:2: client declared but not used

      It looks like I need to read "Usage" on Github to see whats missing. Which, if I was a newer MongoDB customer this would be a pain, especially if I just wanted to test connecting or wanted quick bootstrap code like our other driver docs offer. This instruction is so barebones, _you actually have to read GitHub. _

      You have to add an additional option for client in this case.
      I added this:
      err = client.Ping(ctx, readpref.Primary())
      This satisfied the client variable use.
      Because without, you get the error above. There might be other ways that are better, unclear.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            chris.cho@mongodb.com Christopher Cho (Inactive)
            rachelle.palmer@mongodb.com Rachelle Palmer
            0 Vote for this issue
            3 Start watching this issue

              3 years, 47 weeks, 6 days ago