-
Notifications
You must be signed in to change notification settings - Fork 91
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
Same packaged referenced from two paths isn't recognized #41
Comments
yeah I think it makes sense to resolve everything to absolute package paths |
Actually I think #40 addresses that, sorry it's been a while since I looked. Do you mind giving that PR a try, and if it works for you, I can merge it. |
I'll give it a try when I'm back in the office on Monday. |
It seems like #40 only makes the situation worse as I can no longer even generate a graph for the project. I've created this sample project to work along with: https://github.com/nathan-fiscaletti/godepgraph-example If i use the regular tool, it works just fine (minus the issue of showing the same package twice with different paths)
However, if i use the version compiled from #40 i see this:
Additionally, If i try to use the github URL itself I see this:
(although this may be related to using relative paths in a github repository, I'm not sure) |
Hi @kisielk and @nathan-fiscaletti , it's not the case that #40 is trying to resolve here. In your case, it's
Things have changed since then and I have no idea how go package listing deals with it, I guess it just doesn't deal with it properly yet. But using relative path is not a good practice and should be avoided in most cases. Using go mod may allow
|
If you have a package in a directory named
somepackage
and import it from yourmain
package usingand then you have another package named
otherpackage
and importsomepackage
in it usingIt will be picked up as two separate packages, one being
./somepackage
and the other being../somepackage
.Potential Fix
For local packages like this, would it work better to resolve the absolute paths of relative packages. If two are the same, ommit one.
Afterwards, you can update their names again by generating the relative path to the package from the main package. Does this make sense?
The text was updated successfully, but these errors were encountered: