-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.GoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
We've all hit the common:
package foo
imports whatever1
imports whatever2
imports whatever3
imports bar: import cycle not allowed
It would great if it showed the actual file name of the imports, so that when there are multiple files in a package, it's easier to narrow down which one is the offender.
Eg:
package foo: blah.go
imports whatever1: file1.go
imports whatever2: something.go
imports whatever3: thing.go
imports bar: import cycle not allowed
Of course a more symmetrical approach might look like:
import cycle not allowed
imports foo: blah.go
imports whatever1: file1.go
imports whatever2: something.go
imports whatever3: thing.go
imports package foo
But whatever the formatting the code idea is that we make it easier for the user to know which file was part of the loop.
What about the situation of more than one file offending? Well this is a topological sort, so we already only guarantee that we print a single loop, even when there are more than one paths.
Of note, we don't want a full absolute path printed, we already know where things should be based on package name, we do care about the relative file path in that package.
Thanks!
gerbenjacobs, purpleidea, nebiros, jhelberg, tomasaschan and 10 more
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.GoCommandcmd/gocmd/goNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.