You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating Golang modules, we do not need to explicitly keep track of which dependencies are needed for inclusion in the go.mod file. It is enough to use go mod tidy to have Go automatically determine the module dependencies to include.
Currently, the Golang module builder does track modules and explicitly constructs the go.mod file. We can simplify the code by removing this logic.
One caveat is unpublished modules -- a module might depend on a sibling module on the local filesystem that cannot be resolved using its import URL. In this case the go.mod file needs a replace directive to point to the sibling directory. Currently, the Golang workspace builder adds this replace directive. The replace directive will be need before we can invoke go mod tidy. This should be a minor tweak.
This change will also result in some code being removed from plugins, which are currently explicitly adding the required modules to the modulebuilder; now they don't need to do that at all.
The text was updated successfully, but these errors were encountered:
In GitLab by @JonathanMace on Sep 18, 2023, 20:17
See #6 for a discussion.
When generating Golang modules, we do not need to explicitly keep track of which dependencies are needed for inclusion in the go.mod file. It is enough to use
go mod tidy
to have Go automatically determine the module dependencies to include.Currently, the Golang module builder does track modules and explicitly constructs the go.mod file. We can simplify the code by removing this logic.
One caveat is unpublished modules -- a module might depend on a sibling module on the local filesystem that cannot be resolved using its import URL. In this case the go.mod file needs a
replace
directive to point to the sibling directory. Currently, the Golang workspace builder adds this replace directive. The replace directive will be need before we can invokego mod tidy
. This should be a minor tweak.This change will also result in some code being removed from plugins, which are currently explicitly adding the required modules to the modulebuilder; now they don't need to do that at all.
The text was updated successfully, but these errors were encountered: