mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
When a package contains both a var and an import that produce the same identifier, the compiler will complain. I had thought that it made sense to remove the redundant imports in that case. However, we can't reliably tell whether a global from one file is in scope in another file. Most notably, having multiple main packages in the same directory is pretty common, and if someone declares a var in one that matches an import in another, we don't want to remove the import. Change-Id: I49f58fccdb8a8542ec85cf4d80d3e20d3159d2c7 Reviewed-on: https://go-review.googlesource.com/c/154740 Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>