Go-godoc帮助系统

u013344915 · · 3521 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

可以用godoc查询某个包/package/库或库函数的使用方法。通过这个命令,就可以在本地快速查找某个函数的使用方法&示例,对于效率提升还是很有帮助。示例:

D:\examples>godoc fmt Println
use 'godoc cmd/fmt' for documentation on the fmt command

func Println(a ...interface{}) (n int, err error)
    Println formats using the default formats for its operands and writes to
    standard output. Spaces are always added between operands and a newline
    is appended. It returns the number of bytes written and any write error
    encountered.

可以尝试执行如下命令:

godoc cmd/fmt
godoc cmd/math
godoc cmd/math Sqrt 

需要注意的是,godoc对于函数名称区分大小写。

这个godoc和python的pydoc命令有点类似。


有疑问加站长微信联系(非本文作者)

本文来自:CSDN博客

感谢作者:u013344915

查看原文:Go-godoc帮助系统

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

3521 次点击  
加入收藏 微博
上一篇:go 单元测试
下一篇:vim-go更新小记
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传