Go 语言 - 命令文档

命令文档

这是一套用来构建并处理Go源码的程序。在该套件

运行这些程序最普通的方式就是作为go程序的子命令,例如 go fmt。若像这样运行,该命令就会在Go源码的完整包上进行操作,它使用go程序通过适当的实参来调用基本的二进制程序以进行包级处理。

也可作为独立的二进制程序,加上未修改的实参,并使用go的 tool子命令来运行,例如 go tool vet。以下调用风格也是允许的,例如,检查一个单一源文件而非整个包:go tool vet myprogram.go对比于 go vet mypackage。有一些命令,如 yacc,只能通过go的 tool 子命令来访问。

最后,fmtdoc 两个命令也作为常规的二进制被安装为gofmt godoc,因为它们偶尔会被引用。

欲获取更多文档、调用方法及用法详述,请点击以下链接。

名称 简介
go go 程序管理Go源码以及运行其它在此列出的命令。用法详述见命令文档。
cgo Cgo 使Go包的创建能够调用C代码。
cover Cover 用于创建并优化由 "go test -coverprofile" 生成的规模评估。
fix Fix 发现使用旧语言与库特性的Go程序,并使用较新的特性来重写它们。
fmt Fmt 格式化Go包,它作为独立的gofmt命令,使用更一般的选项同样有效。
godoc Godoc 从Go包中提取并生成文档。
vet Vet 检查Go源码并报告可疑的构造,例如Printf调用的实参数与格式化字符串不匹配。
yacc Yacc 是yacc的一个版本,它生成在Go中实现的解析器。

这是一个简略的列表。编译器及更多文档见完整的命令参考


Directory /src/cmd

Name 摘要
..
5a 5a is a version of the Plan 9 assembler.
5c 5c is a version of the Plan 9 C compiler.
5g 5g is the version of the gc compiler for the ARM.
5l 5l is the linker for the ARM.
6a 6a is a version of the Plan 9 assembler.
6c 6c is a version of the Plan 9 C compiler.
6g 6g is the version of the gc compiler for the x86-64.
6l 6l is the linker for the x86-64.
8a 8a is a version of the Plan 9 assembler.
8c 8c is a version of the Plan 9 C compiler.
8g 8g is the version of the gc compiler for the x86.
8l 8l is the linker for the 32-bit x86.
addr2line Addr2line is a minimal simulation of the GNU addr2line tool, just enough to support pprof.
api Binary api computes the exported API of a set of Go packages.
cc This directory contains the portable section of the Plan 9 C compilers.
cgo Cgo enables the creation of Go packages that call C code.
fix Fix finds Go programs that use old APIs and rewrites them to use newer ones.
gc Gc is the generic label for the family of Go compilers that function as part of the (modified) Plan 9 tool chain.
go Go is a tool for managing Go source code.
gofmt Gofmt formats Go programs.
internal  
     objfile Package objfile implements portable access to OS-specific executable files.
ld Ld is the portable code for a modified version of the Plan 9 linker.
link TODO(rsc): Handle go.typelink, go.track symbols.
nm Nm lists the symbols defined or used by an object file, archive, or executable.
objdump Objdump disassembles executable files.
pack Pack is a simple version of the traditional Unix ar tool.
yacc Yacc is a version of yacc for Go.
     expr Expr is a simple expression evaluator that serves as a working example of how to use Go's yacc implemenation.

需要更多包?看看子代码库其它Go项目吧!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值