From 3b7a2a02d3542e4e0b731bf787026aee909ae776 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sun, 9 Mar 2025 10:56:47 +0100 Subject: [PATCH] docs(gomod): add info on go.mod directive (#34713) --- lib/modules/manager/gomod/readme.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/modules/manager/gomod/readme.md b/lib/modules/manager/gomod/readme.md index d5a97547b7..26fc189d0c 100644 --- a/lib/modules/manager/gomod/readme.md +++ b/lib/modules/manager/gomod/readme.md @@ -1,3 +1,26 @@ +### Updating of Go mod and toolchain directives + +In `go.mod`, the `go` directive essentially means "Compatible with this version or later". +It is generally recommended for Go projects to _not_ bump this version unless necessary, and therefore Renovate's default behavior is not to propose upgrades to it. +If you need to update it once or irregularly, it's recommended to do it manually. +If you are sure you want to always bump it to latest, then you need the following configuration: + +```json +{ + "packageRules": [ + { + "matchManagers": ["gomod"], + "matchDepNames": ["go"], + "matchDepTypes": ["golang"], + "rangeStrategy": "bump" + } + ] +} +``` + +In `go.mod`, the `toolchain` directive essentially means "Use this exact version of go". +Unlike the `go` directive, it's valid to keep bumping this, and you should see updates to it proposed by default. + ### Post-Update Options You might be interested in the following `postUpdateOptions`: -- GitLab