-
HonkingGoose authoredHonkingGoose authored
golang.md 4.64 KiB
title: Go Modules
description: Go modules support in Renovate
Automated Dependency Updates for Go Modules
Renovate supports upgrading dependencies in go.mod
files and associated go.sum
checksums.
If you're self-hosting Renovate, you may use these environment variables:
GOPROXY
GONOPROXY
GOPRIVATE
GOINSECURE
To learn what these variables do, read the Go Modules Reference about theGOPROXY
protocol.
How It Works
- Renovate searches in each repository for any
go.mod
files - Renovate extracts existing dependencies from
require
statements - Renovate resolves the dependency's source repository and checks for SemVer tags if found. Otherwise commits and
v0.0.0-....
syntax will be used - If Renovate finds an update, Renovate will update
go.mod
to the new value - Renovate runs
go get
to update thego.sum
files (you can configure which directory are included using thegoGetDirs
option) - If the user has enabled the option
gomodUpdateImportPaths
in thepostUpdateOptions
array, then Renovate uses mod to update import paths on major updates, which can update any Go source file - If the user has any of the available
gomodTidy
options (e.g.gomodTidy1.17
) in thepostUpdateOptions
, then Renovate runsgo mod tidy
with the respective options (multiple options are allowed). -
go mod vendor
is run if vendored modules are 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
Renovate updates Go Modules by default. To install Renovate Bot itself, either enable the Renovate App on GitHub, or check out Renovate OSS for self-hosted.