Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not find any module could update in go worksapce #35

Closed
DingYou opened this issue Jan 17, 2023 · 2 comments
Closed

not find any module could update in go worksapce #35

DingYou opened this issue Jan 17, 2023 · 2 comments

Comments

@DingYou
Copy link

DingYou commented Jan 17, 2023

There are two modules in a go workspace like this
image
image
then run go-mod-upgrade, It always print "All modules are up to date"
image

I tried to find what's wrong.
When I run go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all, I found that the Indirect field is always true. It seems a bug in go list.
I think we can change a way to pick out the indirect moudles.
I forked this repo and tried to use go mod edit -json , it works well.
image

I am going to submit a PR later, please review it, thanks.

oligot pushed a commit that referenced this issue Jan 18, 2023
When a module is inside a workspace (sub directory), the "go list"
command returns that all modules are up to date, which is not the case.
Disabling Go workspace mode when running "go list" fixes the issue.
@oligot
Copy link
Owner

oligot commented Jan 18, 2023

Hi,

Indeed, this is an issue.
I've solved it a bit differently than your suggestion (in the PR #36).
See commit a581599
The main idea is to disable Go workspace mode when running the "go list" command.
I've tested it locally and it now works as expected.

Could you try on your side and tell me if it also works for you ?

Thanks !

@DingYou
Copy link
Author

DingYou commented Jan 20, 2023

Hi,

Indeed, this is an issue. I've solved it a bit differently than your suggestion (in the PR #36). See commit a581599 The main idea is to disable Go workspace mode when running the "go list" command. I've tested it locally and it now works as expected.

Could you try on your side and tell me if it also works for you ?

Thanks !

Yeah, it works! Simple and useful, what a great solution!Thanks!

@DingYou DingYou closed this as completed Jan 20, 2023
alessiosavi added a commit to alessiosavi/go-mod-upgrade that referenced this issue Jan 24, 2023
Fix issue oligot#35 - module inside workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants