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

it doesn't seem to see submodules #39

Open
amery opened this issue Mar 18, 2023 · 7 comments
Open

it doesn't seem to see submodules #39

amery opened this issue Mar 18, 2023 · 7 comments

Comments

@amery
Copy link

amery commented Mar 18, 2023

I use submodules a lot, and by that I mean nested go.mod in the same git repository following what some people calls a MonoRepo.

unfortunately if I run golds -allow-network-connection -port 6060 -v . at a checkout of https://github.com/darvaza-proxy/slog for example, handlers/*/go.mod are ignored.

suggestions?

@amery
Copy link
Author

amery commented Mar 18, 2023

and passing all the directories with a go.mod as argument leads to server.go:314: no packages matched (with or without trailing /...)

@zigo101
Copy link
Collaborator

zigo101 commented Mar 19, 2023

@amery
It looks the submodules app require the root module.
This means there are more than one starting/seed modules.
Golds is unable to handle such situation: #25 (comment)

Thanks for submitting this issue, which let me find a bug in Golds.
This bug makes Golds fail to parse any single one of the submodules in the https://github.com/darvaza-proxy/slog project.
The bug will be fixed in the next release.

After the bug is fixed, Golds is able to parse any single one of the submodules, but still unable to parse them all at the same time.

@amery
Copy link
Author

amery commented Mar 19, 2023

@go101 the pattern there is that the root defines an interface, and submodules implement it

@zigo101
Copy link
Collaborator

zigo101 commented Mar 20, 2023

(moved from golang/go#59056):

Yes, as Golds provides some richer features, such as showing be-direction relations between deping and deped packages (such as type implementation relation), there are some difficulties to parse multiple versions of a package at the same time, which is often caused by parsing multiple seed modules.

I believe the limitation originates from the golang.org/x/tools/go/packages package, though it is possible to make (some heavy) efforts to let Golds work through the limitation.

wouldn't the dependency graph sort that instead of assuming the first package is the leaf?

@amery
I don't get what you mean. What is a leaf?

@amery
Copy link
Author

amery commented Mar 20, 2023

@go101 a node on the graph who no one depends on

@zigo101
Copy link
Collaborator

zigo101 commented Mar 20, 2023

The problem is two leaf/seed modules might require two different (minor) versions of a module.
Neither parsing both nor parsing either of the two versions is guaranteed to be without problems.

@amery
Copy link
Author

amery commented Mar 20, 2023

The problem is two leaf/seed modules might require two different (minor) versions of a module. Neither parsing both nor parsing either of the two versions is guaranteed to be without problems.

I understand now what you meant, thanks

@zigo101 zigo101 reopened this Mar 23, 2023
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

No branches or pull requests

2 participants