Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1227

Goland throw warnings from client.Ping method

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 1.0.4
    • Connections
    • None

    Description

      I'm using JetBrains Goland IDE with next simple code to connection ping

      // code placeholder
      ctx, cancel := context.WithTimeout(context.Background(), appConfig.DB.Timeout*time.Second)
      client, err := mongo.Connect(ctx, options.Client().ApplyURI(appConfig.DB.URI))
      defer cancel()
      //Call the connect function of client
      //noinspection GoNilness
      err = client.Ping(ctx, readpref.Primary())
      if err != nil {
         logrus.WithField("mongo", appConfig.DB.URI).Fatal("Mongo connection failed after timeout")
      } else {
         logrus.WithField("mongo", appConfig.DB.URI).Info("Mongo connected")
         appConfig.DB.Client = client
      }
      

      method err = client.Ping(ctx, readpref.Primary()) show an error with message:

      Can I fix myself in my code or it's deeper?

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ivan.skiridomov@gmail.com Ivan Skiridomov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: