命令文档
这是一套用来构建并处理Go源码的程序。在该套件
运行这些程序最普通的方式就是作为go程序的子命令,例如 go fmt
。若像这样运行,该命令就会在Go源码的完整包上进行操作,它使用go程序通过适当的实参来调用基本的二进制程序以进行包级处理。
也可作为独立的二进制程序,加上未修改的实参,并使用go的 tool
子命令来运行,例如 go tool vet
。以下调用风格也是允许的,例如,检查一个单一源文件而非整个包:go tool vet myprogram.go
对比于 go vet mypackage
。有一些命令,如 yacc
,只能通过go的 tool
子命令来访问。
最后,fmt
与 doc
两个命令也作为常规的二进制被安装为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. |