From 05304d081e4c6c629d6f6b60944bd2b3255296ce Mon Sep 17 00:00:00 2001 From: katexochen <49727155+katexochen@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:07:51 +0200 Subject: [PATCH] Inform about Go workspaces in CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac370a109..62928acbd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,12 +18,28 @@ but there is also a CI action to ensure compliance. To locally run all configured linters, execute -``` +```sh golangci-lint run ./... ``` It is also recommended to use golangci-lint (and [gofumpt](https://github.com/mvdan/gofumpt) as formatter) in your IDE, by adding the recommended VS Code Settings or by [configuring it yourself](https://golangci-lint.run/usage/integrations/#editor-integration) +## Nested Go modules + +As this project contains nested Go modules, it is recommended to create a local Go workspace, so your IDE can lint multiple modules at once. + +```go +go 1.18 + +use ( + . + ./hack +) +``` + +You can find an introduction in the [Go workspace tutorial](https://go.dev/doc/tutorial/workspaces). + +If you have changed dependencies within a module and have run `go mod tidy`, you can use `go work sync` to sync versions of the same dependency of the different modules. ## Recommended VS Code Settings