fix(gomod): getting dep name with no version
Changes
Fixed getting a name with no version when doing a go mod update.
Context
There is a process that compares depName and depName with no version. and when getting depName with no version from depName, It only can handle the depName that has three elements separated by '/'. It causes some problems like described below:
- gomodules.xyz/jsonpatch/v2 v2.2.0
+ gomodules.xyz/jsonpatch/v2/v3 v3.0.1
It should upgrade like gomodules.xyz/jsonpatch/v3 v3.0.1.
Also, Handling the depName containing gopkg.in/ is duplication because it is handled below.
https://github.com/renovatebot/renovate/blob/55898f85ae2f1c727ae0478a059b5c392ccc9c51/lib/modules/manager/gomod/update.ts#L97-L101
Documentation (please check one with an [x])
- [ ] I have updated the documentation, or
- [X] No documentation update is required
How I've tested my work (please select one)
I have verified these changes via:
- [ ] Code inspection only, or
- [x] Newly added/modified unit tests, or
- [ ] No unit tests but ran on a real repository, or
- [ ] Both unit tests + ran on a real repository
Can you add a test to prevent regression please?
@JamieMagee added :)
@sangheee as you haven't granted maintainer edit permissions, we can't update this branch or fix any of the problems. Please reopen with "Maintainers can edit" permissions.