Add Go workspace related commands

This commit is contained in:
James Skemp 2023-04-15 08:25:22 -05:00
parent 2aae4c65fe
commit b23050b4c9
1 changed files with 12 additions and 0 deletions

View File

@ -34,4 +34,16 @@ go list -f '{{.Target}}'
```powershell
# Update go.mod to point a module to a local directory.
go mod edit -replace example.com/greetings=../greetings
# Get an external module and add to go.mod require.
go get golang.org/x/example
```
## Workspaces
```powershell
# Initialize a workspace with an existing module.
go work init ./hello
# Add a child module directory to the workspace.
go work use ./example
```