cmd/go: package imported multiple times from GOPATH and vendor #28207
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11.1 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Package
p
importsq
,q
is inp
's vendor.There is also a
q
package inGOPATH
, i.e,q
is in both GOPATH andp
's vendor:I have a test.go, it imports both
p
andq
:Then package
q
will be import twice, and theinit
function run twice, results in the following error:What did you expect to see?
Go should handle packages in vendor and GOPATH, don't import them twice.
What did you see instead?
The same package been import twice and their
init
function conflicts.The text was updated successfully, but these errors were encountered: