Add Go workspace related commands
This commit is contained in:
parent
2aae4c65fe
commit
b23050b4c9
|
@ -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
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue