[gomod] major updates break for packages with few / in package name
#35507
How are you running Renovate?Self-hosted Renovate If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.GitHub Enterprise Server/39.257.1 Please tell us more about your question or problemWhen updating to a new major version in Go modules, Renovate modifies the package suffix from, for example, Upon investigation, I discovered the issue in the following code segment of Renovate: renovate/lib/modules/manager/gomod/update.ts Lines 6 to 12 in 7ed07b1 This code attempts to extract the package name without the version by utilizing a splitting logic, which works for To resolve this issue, I suggest modifying the code to remove the function getNameWithNoVersion(name: string): string {
// Remove version suffixes like /v1 or /v2
let nameNoVersion = name.replace(/\/v\d+$/, '');
// Handle gopkg.in special case where the major version is added with a dot rather than a slash
if (nameNoVersion.startsWith('gopkg.in')) {
nameNoVersion = nameNoVersion.replace(/\.v\d+$/, '');
}
return nameNoVersion;
}I have a corresponding Pull Request ready and will open it in a second. (Edit: #35508) You can see the reproduction pull request here: https://github.com/Shegox/major-update-problem/pull/2/files Logs (if relevant)Logs |
Fixed via #35508 released in 39.257.4