go的子命令与工具

作者: 李佶澳   转载请保留:原文地址   发布时间:2017/05/18 16:00:04

go的全部子命令

运行命令go,就可以看到go的子命令:

$go
Go is a tool for managing Go source code.

Usage:
	
	go command [arguments]
	
The commands are:
	
	build       compile packages and dependencies
	clean       remove object files
	doc         show documentation for package or symbol
	env         print Go environment information
	fix         run go tool fix on packages
	fmt         run gofmt on package sources
	generate    generate Go files by processing source
	get         download and install packages and dependencies
	install     compile and install packages and dependencies
	list        list packages
	run         compile and run Go program
	test        test packages
	tool        run specified go tool
	version     print Go version
	vet         run go tool vet on packages
	
Use "go help [command]" for more information about a command.

Command go中做了详细介绍。

出了这些子命令,go还有一些特殊用途的工具,go tool可以看到这些工具:

$go tool
addr2line
api
asm
cgo
compile
cover
dist
doc
fix
link
nm
objdump
pack
pprof
trace
vet
yacc

Go’s Tools中介绍了这些工具。

generate

generate用来执行代码注释指定的命令:

//go:generate command argument...

command是任意指定的,通常用来对代码预先处理。go generate必须手动执行,go build等不会自动触发generate的运行。

参考

  1. Command go

欢迎加微信,最好备注姓名和方向

QQ交流群

区块链实践互助QQ群:576555864

Kubernetes实践互助QQ群:947371129

Prometheus实践互助QQ群:952461804

API网关Kong实践互助QQ群:952503851

Ansible实践互助QQ群:955105412

Copyright @2011-2018 All rights reserved. 转载请添加原文连接,合作请加微信lijiaocn或者发送邮件: lijiaocn@foxmail.com,备注网站合作 友情链接: lijiaocn github.com