Repository: moby/moby (language: go)

Issue:
IDE doesn't recognize the moby repositiory as a Go project
**Description**

When working with the Moby repository from the IDE like GoLand, dependencies in the vendor directory are not properly recognized. This is caused by the fact that instead of standard `go.mod` file Moby opted in for custom `vendor.mod` and `vendor.sh` script that manages vendor directory. This means that IDE does not recognize the directory as a Go project and doesn't bother with checking vendor directory for dependencies. As a result, dependencies are not resolved and code completion doesn't work properly:

![code completion not working](https://user-images.githubusercontent.com/4958634/161403832-97548274-6bdd-41a3-a921-29c7e90bdc2f.png)

However, executing `./hack/vendor.sh` not only makes sure that all the dependencies in the vendor directory are in sync with the `vendor.mod` file, but also generates a `go.mod` one. Although the file is almost empty (has only the module name and Go version), it’s enough for the IDE to properly recognize the directory as a project and load dependencies from the vendor directory. After a moment, code highlighting works as expected:

![code completion working](https://user-images.githubusercontent.com/4958634/161403834-c2d5c2b8-dd19-4217-a0cb-555d9d1bceb0.png)

Although it was a pretty easy fix, it is not mentioned anywhere in the contribution guide and it’s not obvious that the `vendor.sh` script should be executed. What’s more, there is no mention of what the `vendor.mod` file actually is and why the standard `go.mod` isn’t used. It would be good to have a short section in the contribution guide, dedicated to “preparing” the project for working with IDE if somebody wants to use it - even if that preparation is merely executing the `vendor.sh` script, so that IDE can launch its own project management procedures.

**Steps to reproduce the issue:**
In GoLand 2021.3:
1. Clone repository
2. Open directory in GoLand
3. Open arbitrary Go file (eg. `daemon.go`)
4. Dependencies are not resolved, code completion doesn't work properly
5. Execute `./hack/vendor.sh`
6. GoLand indexes the vendor directory and code completion is now working




Discussion / hints:

Fix patch:
diff --git a/docs/contributing/README.md b/docs/contributing/README.md
index 915c0cff1ea28..4fc5dcfd9bf4a 100644
--- a/docs/contributing/README.md
+++ b/docs/contributing/README.md
@@ -3,6 +3,7 @@
  * [README first](who-written-for.md)
  * [Get the required software](software-required.md)
  * [Set up for development on Windows](software-req-win.md)
+ * (Optional) [Configure project for IDE](set-up-ide.md)
  * [Configure Git for contributing](set-up-git.md)
  * [Work with a development container](set-up-dev-env.md)
  * [Run tests and test documentation](test.md)
diff --git a/docs/contributing/images/ide_custom_gopath.png b/docs/contributing/images/ide_custom_gopath.png
new file mode 100644
index 0000000000000..fc5e995266da7
Binary files /dev/null and b/docs/contributing/images/ide_custom_gopath.png differ
diff --git a/docs/contributing/images/ide_go_modules_integration.png b/docs/contributing/images/ide_go_modules_integration.png
new file mode 100644
index 0000000000000..b4bfa53385c00
Binary files /dev/null and b/docs/contributing/images/ide_go_modules_integration.png differ
diff --git a/docs/contributing/images/ide_system_environment_gopath.png b/docs/contributing/images/ide_system_environment_gopath.png
new file mode 100644
index 0000000000000..1f8c88f4d59da
Binary files /dev/null and b/docs/contributing/images/ide_system_environment_gopath.png differ
diff --git a/docs/contributing/set-up-ide.md b/docs/contributing/set-up-ide.md
new file mode 100644
index 0000000000000..29d8ef5c5899a
--- /dev/null
+++ b/docs/contributing/set-up-ide.md
@@ -0,0 +1,36 @@
+### Configure project for IDE (optional)
+
+In this section you will configure the project in order to make use of [GoLand](https://www.jetbrains.com/go)
+integrated development environment's (IDE) features like syntax highlighting and code completion.
+
+## 1. Place repository to the GOPATH
+
+The repository has to be placed under `src` directory in GOPATH.
+The default location for Linux and macOS users is `~/go`, while for Windows it is `%USERPROFILE%\go`.
+
+Move the previously cloned repository or clone it again to the `<GOPATH>/src/github.com/docker/docker` directory.
+
+## 2. Configure IDE
+
+Open the `<GOPATH>/src/github.com/docker/docker` directory in GoLand.
+Then open the settings (Ctrl+Alt+S) and change two settings:
+
+1. Disable Go modules integration
+
+![Disabling Go modules integration](images/ide_go_modules_integration.png)
+
+3. Disable using system environment's GOPATH
+
+![Disabling using system environment's GOPATH](images/ide_system_environment_gopath.png)
+
+### Custom GOPATH
+
+In case the custom GOPATH is used (for example to have multiple copies of the cloned repository),
+it has to be configured in the settings as well:
+
+![Configuring custom GOPATH](images/ide_custom_gopath.png)
+
+## Where to go next
+
+Congratulations, you have finished configuring project to work with the IDE. 
+In the next section you'll [learn how to set up and work in a Moby development container](set-up-dev-env.md).
diff --git a/docs/contributing/software-req-win.md b/docs/contributing/software-req-win.md
index 55b370003f964..0730fb586e31b 100644
--- a/docs/contributing/software-req-win.md
+++ b/docs/contributing/software-req-win.md
@@ -173,5 +173,7 @@ https://github.com/kevpar/docker-w2wCIScripts/blob/master/runCI/Invoke-DockerCI.
 
 ## Where to go next
 
-In the next section, you'll [learn how to set up and configure Git for
-contributing to Moby](set-up-git.md).
+In the next section, you'll [configure the project to be properly recognized by the IDE](set-up-ide.md).
+
+If you don't want to use IDE, you can proceed to the next step
+and [learn how to set up and configure Git for contributing to Moby](set-up-git.md).
diff --git a/docs/contributing/software-required.md b/docs/contributing/software-required.md
index b14c6f9050d79..b9d6950215b16 100644
--- a/docs/contributing/software-required.md
+++ b/docs/contributing/software-required.md
@@ -90,5 +90,7 @@ You must log out and log back in for this modification to take effect.
 
 ## Where to go next
 
-In the next section, you'll [learn how to set up and configure Git for
-contributing to Moby](set-up-git.md).
+In the next section, you'll [configure the project to be properly recognized by the IDE](set-up-ide.md).
+
+If you don't want to use IDE, you can proceed to the next step
+and [learn how to set up and configure Git for contributing to Moby](set-up-git.md).
\ No newline at end of file


Test patch: