We have added support for monorepos in the Go analyzer.
Before this release, if you had a Go project with import path other than the repository root, or have multiple import paths, some packages would not be loaded, and some issues were not detected.
For example, if the repository lies at
github.com/deepsourcelabs/web and the Go project lies at
github.com/deepsourcelabs/web/backend, in the previous version, the DeepSource analyzer would fail to recognize a lot of packages, and hence, miss out a lot of issues.
We have now added support for multiple import paths, and handled the scenario when the import path is different from import root.
To do so, we have added 2 new fields to be added in the meta of the
import_paths: An array of import paths that has to be analyzed. In the above repository’s example, the value of
import_root: The root of the repository. In the above example, the value of
"github.com/deepsourcelabs/web". If the
import_pathsarray contains only a single value, and no value is provided for
import_root, the value of import path is considered the import root.
The new field
import_paths (array) is added in place of
import_path is still supported for any repository that still uses it, this field has been deprecated, and we would recommend using the
For more details, refer to the docs.