go tool 命令

go 编译命令

go tool

在这里插入图片描述
(1) go tool compile -S main.go
反编译代码为汇编代码

(2) GOOS=linux GOARCH=amd64 go tool compile -S -N -l main.go
禁止内联生成伪汇编代码

go build

go build 命令用于编译我们指定的源码文件或代码包以及它们的依赖包。
(2) go build -gcflags=-m main.go

go build -gcflags '-m -l' xxx.go
打印出编译器逃逸分析的过程,使用 -m 参数。

go test

go test 
	-bench=. 
	-run=^$ 
	-cpu=1,2,4 
	-benchtime=10s 
	-count=10
	-benchmem 
	bufio
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章