mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 16:35:53 +02:00
go-build: apply suggestions
Signed-off-by: gonejack <igonejack@gmail.com>
This commit is contained in:
parent
7221d87294
commit
ae117a5437
1 changed files with 14 additions and 6 deletions
|
@ -1,12 +1,20 @@
|
||||||
# go build
|
# go build
|
||||||
|
|
||||||
> Tool for compiling packages and dependencies.
|
> Compile Go sources.
|
||||||
> More information: <https://golang.org/cmd/go/>.
|
> More information: <https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies>.
|
||||||
|
|
||||||
- Compile a source file into a named executable:
|
- Compile a file:
|
||||||
|
|
||||||
`go build -o {{executable}} {{path/to/main/file}}.go`
|
`go build path/to/main.go`
|
||||||
|
|
||||||
- Compile a main package into a named executable:
|
- Compile into named output:
|
||||||
|
|
||||||
`go build -o {{executable}} {{path/to/main/package}}`
|
`go build -o {{binary}} path/to/source.go`
|
||||||
|
|
||||||
|
- Compile a package:
|
||||||
|
|
||||||
|
`go build -o {{binary}} path/to/package`
|
||||||
|
|
||||||
|
- Compile a main package into an executable, with data race detection:
|
||||||
|
|
||||||
|
`go build -race -o {{executable}} path/to/main/package`
|
||||||
|
|
Loading…
Add table
Reference in a new issue