-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version devel +4b3f04c63b Thu Jan 10 18:15:48 2019 +0000 linux/amd64
As of commit 0a99049, goimports does not seem to consider the local package as a candidate for an external test.
Here's a testscript example that demonstrates the issue:
exec goimports -w a_test.go
cmp a_test.go a_test.go-goimports
-- go.mod --
module example.com/a
-- a_test.go --
package a_test
func TestX() {
a.X()
a.Y()
}
-- a.go --
package a
func X() {
}
-- export_test.go --
package a
func Y() {
}
-- a_test.go-goimports --
package a_test
import "example.com/a"
func TestX() {
a.X()
a.Y()
}
I would expect running goimports on a.go to add an import of example.com/a.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone 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.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.