2.6 KiB
title | description |
---|---|
Go Modules | Go modules support in Renovate |
Automated Dependency Updates for Go Modules
Renovate supports upgrading dependencies in go.mod
files and their accompanying go.sum
checksums.
How It Works
- Renovate will search each repository for any
go.mod
files. - Existing dependencies will be extracted from
require
statements - Renovate will resolve the dependency's source repository and check for semver tags if found. Otherwise commits and
v0.0.0-....
syntax will be used. - If an update was found, Renovate will update
go.mod
to the new value - Renovate will run
go get
to update thego.sum
files. - If the user has enabled the option
gomodTidy
in thepostUpdateOptions
array, then Renovate will rungo mod tidy
, which itself can updatego.mod
andgo.sum
. go mod vendor
will be run if vendored modules have been detected.- A PR will be created with
go.mod
,go.sum
, and any updated vendored files updated in the one commit - If the source repository has either a "changelog" file or uses GitHub releases, then Release Notes for each version will be embedded in the generated PR.
Enabling Go Modules Updating
Go Modules updating is on by default in Renovate Bot. To install Renovate Bot itself, either enable the Renovate App on GitHub, or check out Renovate OSS or Renovate Pro for self-hosted options.
Technical Details
Module Tidying
Go Modules tidying is not enabled by default, and so is opt-in via the postUpdateOptions
config option. The reason for this is that a go mod tidy
command may make changes to go.mod
and go.sum
that are completely unrelated to the updated module(s) in the PR, and so may be confusing to some users.
Module Vendoring
Vendoring of Go Modules is done automatically if vendor/modules.txt
is present. Renovate will commit all files changed within the vendor/
folder.
Go binary version
Currently, Renovate will try to keep up with the very latest version of go
, and it is not configurable. It is planned though to support a configurable version of go
per-repository soon.
gitFs
Go Modules tidying and vendoring are both only possible if gitFs
is in use. If you are using the hosted Renovate App, then it should be enabled by default, but if you are self-hosting your Renovate Bot then you will need to configure this.