Add new page for Go

This commit is contained in:
James Skemp 2023-04-14 22:15:35 -05:00
parent b51827675e
commit 2aae4c65fe
2 changed files with 38 additions and 0 deletions

View File

@ -13,5 +13,6 @@
- [PostgreSQL](./postgresql.md)
- [Angular](./angular.md)
- [.NET](./dotnet.md)
- [Go](./golang.md)
- [Windows Terminal](./windows-terminal.md)
- [Visual Studio Commands](./visual-studio.md)

37
src/golang.md Normal file
View File

@ -0,0 +1,37 @@
# Go
```powershell
# Initialize a new module.
go mod init example.com/hello
# Run the current directory.
go run .
# Update and cleanup go.mod.
go mod tidy
# Run tests (in files that end with _test.go).
go test
go test -v
# Generate a platform-specific application.
go build
# Install the current application to the Go path.
go install
```
## Information
```powershell
# Get Go's version.
go version
# Find where the current module would be installed to.
go list -f '{{.Target}}'
```
## Requirements
```powershell
# Update go.mod to point a module to a local directory.
go mod edit -replace example.com/greetings=../greetings
```