-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
https://play.golang.org/p/ZnGePWG7Fqs illustrates (at least) two problems with the go/build
API:
-
When
ImportDir
is called on a directory containing files with conflictingpackage
declarations, the returnedbuild.Package
has itsName
field set (arbitrarily!) to the first package-name seen in any of the files, and theInvalidGoFiles
listed for the package include only the files with package names other than the arbitrary one. That seems wrong to me: if the package has conflicting names, it isn't up togo/build
to decide which of those is “correct” — it should report all of the files as erroneous. -
The same file is listed twice in
InvalidGoFiles
.
This issue is about problem (1). (I will fix problem (2) separately, because it seems trivial.)
dmitshur
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.