dqqfuth6736 2013-07-13 10:06
浏览 33
已采纳

如何搜索Go文档?

The documentation is great, but sometimes it is hard to find a specific keyword. For instance, searching for Next()results in this page http://golang.org/search?q=next%28%29 which is not very helpful. Is there a better way to search the documentation?

  • 写回答

3条回答 默认 最新

  • dongsuoxi1790 2013-07-13 11:00
    关注

    Rob Pike wrote the perfect tool for this. Install it with go:

    go get code.google.com/p/rspace.cmd/doc
    

    You can then say doc next (or doc Next) and get an awesome list of Next functions in all packages, along with their documentations and signature. If you know the name of the package, you can say doc sql next or doc sql.next. You can even pass -url to get URL of that documentation online, or -src to get file name and line number for the implementation of that symbol.

    You can access package documentation (documentation that appears at the top of a package’s page and doesn’t belong to any of its items) with -pkg: doc -pkg json.

    doc searches for everything and you can limit it to only search for functions, interfaces, variables, etc. Run it without arguments to get the docs.

    It’s such a great tool. Keep it close when you’re writing in Go.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器