doulan3966
2019-08-24 02:35
浏览 135
已采纳

运行Hello Couchbase应用程序时出现紧急运行时错误[关闭]

Installed go SDK 1.6 following the instructions given here: https://docs.couchbase.com/go-sdk/current/start-using-sdk.html Created Hello Couchbase application as listed on the above page. While running the application, the program panics at the line :slight_smile: for rows.Next(&row) { and produces the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x12d66b2]

Go version prints the following: go version go1.12.9 darwin/amd64 macOS version 10.14.6

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmiao4733 2019-08-24 03:30
    已采纳

    Once you’ve installed the SDK you can run this simple code snippet showcasing some of its features.

    Error checking has been omitted for brevity.

    https://docs.couchbase.com/go-sdk/current/start-using-sdk.html


    In Go, always check for errors. If you check for errors, what errors occur?

    The error

    panic: runtime error: invalid memory address or nil pointer dereference
    

    often indicates that an error was ignored.

    点赞 评论

相关推荐 更多相似问题