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

Go driver getting started instructions do not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: drivers
    • Labels:
      None
    • Last comment by Customer:
      true
    • Story Points:
      2
    • Sprint:
      DET: FY2021Q2S3, DET: FY2021Q2S4

      Description

      Description

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chris.cho Christopher Cho
              Reporter:
              rachelle.palmer Rachelle Palmer
              Participants:
              Last commenter:
              Rachelle Palmer Rachelle Palmer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 4 weeks, 2 days ago
                Date of 1st Reply: