Currently when installing development dependencies through mage, the go.mod file will be updated to include the installed packages since this the default behavior of the go get command when running in module mode.
To prevent the pollution of the project's Go module definition the module mode should be disabled when installing the dev/build packages.
This is a necessary workaround until the Go toolchain is able to install packages globally without updating the module file when the go get command is run from within the project root directory.
Currently when installing development dependencies through mage, the
go.mod
file will be updated to include the installed packages since this the default behavior of thego get
command when running in module mode. To prevent the pollution of the project's Go module definition the module mode should be disabled when installing the dev/build packages. This is a necessary workaround until the Go toolchain is able to install packages globally without updating the module file when thego get
command is run from within the project root directory.See https://github.com/golang/go/issues/30515 for more details and proposed solutions that might be added to Go's build tools in future versions.