Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-8921

Go SDK - Hello Couchbase code is broken.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Critical
    • None
    • None
    • sdk
    • 1

    Description

      Referring to
      https://docs.couchbase.com/go-sdk/current/hello-world/start-using-sdk.html#hello-couchbase

      The code sample is broken. The code sample is

      func main() {
      	cluster, err := gocb.Connect(
      		"localhost",
      		gocb.ClusterOptions{
      			Username: "Administrator",
      			Password: "password",
      		})
      	if err != nil {
      		panic(err)
      	}
      

      The instruction text stays

      Now you have the Go client installed, open your favourite text editor and try out the following:

      If a user tries they will encounter three separate issues:

      1) - No package or imports
      2) - Contains the variable cluster which is not used. Go does not allow unused variables
      3). The brackets to not match - there is a missing trailing bracket.

      We should ensure that all code samples are runnable. Or at least make it clear that this is a short snippet that will not work on its own. (I much prefer the former option)

      thanks

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            amarantha.kulkarni Amarantha Kulkarni (Inactive)
            owend Daniel Owen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty