Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

38
go Normal file
View File

@@ -0,0 +1,38 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# go
> Manage Go source code.
> Some subcommands such as `go build` have their own usage documentation.
> More information: <https://golang.org>.
- Download and install a package, specified by its import path:
`go get {{package_path}}`
- Compile and run a source file (it has to contain a `main` package):
`go run {{file}}.go`
- Compile a source file into a named executable:
`go build -o {{executable}} {{file}}.go`
- Compile the package present in the current directory:
`go build`
- Execute all test cases of the current package (files have to end with `_test.go`):
`go test`
- Compile and install the current package:
`go install`
- Initialize a new module in the current directory:
`go mod init {{module_name}}`