If you have a package in a directory named somepackage and import it from your main package using
import (
"./somepackage"
)
and then you have another package named otherpackage and import somepackage in it using
import(
"../somepackage"
)
It 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?
If you have a package in a directory named
somepackageand import it from yourmainpackage usingand then you have another package named
otherpackageand importsomepackagein it usingIt will be picked up as two separate packages, one being
./somepackageand 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?