go: add Chinese translation (#7799)

This commit is contained in:
Nata Jam 2022-02-21 02:18:49 +08:00 committed by GitHub
parent 6b3ee74467
commit c5bc16a465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

33
pages.zh/common/go.md Normal file
View File

@ -0,0 +1,33 @@
# go
> 管理 Go 源代码的工具。
> 此命令也有关于其子命令的文件,例如:`go build`.
> 更多信息:<https://golang.org>.
- 下载并安装由其路径指定的包:
`go get {{路径/到/包}}`
- 编译并运行一个源文件(它必须包含一个 `main` 包):
`go run {{文件.go}}`
- 将源文件编译为当前命名的可执行文件:
`go build -o {{可执行文件}} {{文件.go}}`
- 编译当前目录中的包:
`go build`
- 执行当前包中的所有测试用例(文件必须以 `_test.go` 结尾):
`go test`
- 编译并安装当前包:
`go install`
- 在当前目录下初始化一个新模块:
`go mod init {{模块}}`