-
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.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.12.9 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/pmihaylov/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/pmihaylov/programming/go" GOPROXY="" GORACE="" GOROOT="/usr/local/Cellar/go/1.12.9/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.12.9/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9v/vvj1r6_54pb855bvmtqv3wn80000gn/T/go-build618023056=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
In a go project:
- Create the file
.gen/foo/foo.gowith contents:
package foo
import "fmt"
func Foo() {
fmt.Println("Foo")
}- Create the file
bar/bar.gowith contents:
package bar
import "fmt"
func Bar() {
fmt.Println("Bar")
}- Create the file
main.gowith contents:
package main
func main() {
foo.Foo()
bar.Bar()
}- Run
goimports main.go.
What did you expect to see?
Both foo and bar packages included
What did you see instead?
Only bar package was included
It would be great if goimports traverses hidden directories as we use a .gen folder for storing auto-generated code (e.g. protobuf). Or at least to export a flag that enables this feature.
From a little tweaking, it seems that Intellij and GoLand already support this feature and that doesn't come from the integrated goimports.
NOTE: If I add the import manually, the program compiles.
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.