mirror of https://github.com/CrimsonTome/tldr.git
go-*: apply additional suggestions
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>client-spec/clarity
parent
8421b10d30
commit
4cac843cae
|
@ -5,16 +5,16 @@
|
||||||
|
|
||||||
- Compile a file:
|
- Compile a file:
|
||||||
|
|
||||||
`go build path/to/main.go`
|
`go build {{path/to/main.go}}`
|
||||||
|
|
||||||
- Compile into named output:
|
- Compile, specifying the output filename:
|
||||||
|
|
||||||
`go build -o {{binary}} path/to/source.go`
|
`go build -o {{path/to/binary}} {{path/to/source.go}}`
|
||||||
|
|
||||||
- Compile a package:
|
- Compile a package:
|
||||||
|
|
||||||
`go build -o {{binary}} path/to/package`
|
`go build -o {{path/to/binary}} {{path/to/package}}`
|
||||||
|
|
||||||
- Compile a main package into an executable, with data race detection:
|
- Compile a main package into an executable, with data race detection:
|
||||||
|
|
||||||
`go build -race -o {{executable}} path/to/main/package`
|
`go build -race -o {{path/to/executable}} {{path/to/main/package}}`
|
||||||
|
|
|
@ -3,18 +3,18 @@
|
||||||
> Remove object files and cached files.
|
> Remove object files and cached files.
|
||||||
> More information: <https://golang.org/cmd/go/#hdr-Remove_object_files_and_cached_files>.
|
> More information: <https://golang.org/cmd/go/#hdr-Remove_object_files_and_cached_files>.
|
||||||
|
|
||||||
- Print the remove commands only:
|
- Print the remove commands instead of actually removing anything:
|
||||||
|
|
||||||
`go clean -n`
|
`go clean -n`
|
||||||
|
|
||||||
- Remove build cache:
|
- Delete the build cache:
|
||||||
|
|
||||||
`go clean -cache`
|
`go clean -cache`
|
||||||
|
|
||||||
- Remove cached test results:
|
- Delete all cached test results:
|
||||||
|
|
||||||
`go clean -testcache`
|
`go clean -testcache`
|
||||||
|
|
||||||
- Remove module cache:
|
- Delete the module cache:
|
||||||
|
|
||||||
`go clean -modcache`
|
`go clean -modcache`
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# go doc
|
# go doc
|
||||||
|
|
||||||
> Show documentation for package or symbol.
|
> Show documentation for a package or symbol.
|
||||||
> More information: <https://golang.org/cmd/go/#hdr-Show_documentation_for_package_or_symbol>.
|
> More information: <https://golang.org/cmd/go/#hdr-Show_documentation_for_package_or_symbol>.
|
||||||
|
|
||||||
- Show documentation for current package:
|
- Show documentation for the current package:
|
||||||
|
|
||||||
`go doc`
|
`go doc`
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
|
|
||||||
`go env`
|
`go env`
|
||||||
|
|
||||||
- Show an environment variable:
|
- Show a specific environment variable:
|
||||||
|
|
||||||
`go env {{GOPATH}}`
|
`go env {{GOPATH}}`
|
||||||
|
|
||||||
- Set an environment value:
|
- Set an environment variable to a value:
|
||||||
|
|
||||||
`go env -w {{GOBIN}}={{path/to/directory}}`
|
`go env -w {{GOBIN}}={{path/to/directory}}`
|
||||||
|
|
||||||
- Reset an environment value:
|
- Reset an environment variable's value:
|
||||||
|
|
||||||
`go env -u {{GOBIN}}`
|
`go env -u {{GOBIN}}`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# go generate
|
# go generate
|
||||||
|
|
||||||
> Generate Go files by processing source.
|
> Generate Go files by running commands within source files.
|
||||||
> More information: <https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source>.
|
> More information: <https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source>.
|
||||||
|
|
||||||
- Generate Go files by running commands within source files:
|
- Generate Go files by running commands within source files:
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
|
|
||||||
`go mod verify`
|
`go mod verify`
|
||||||
|
|
||||||
- Copy all dependencies sources into vendor directory:
|
- Copy sources of all dependencies into the vendor directory:
|
||||||
|
|
||||||
`go mod vendor`
|
`go mod vendor`
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
|
|
||||||
- Print the Go version used to build the named executable file:
|
- Print the Go version used to build the named executable file:
|
||||||
|
|
||||||
`go version {{executable}}`
|
`go version {{path/to/executable}}`
|
||||||
|
|
Loading…
Reference in New Issue