commit | d4971274fe382404aee0e8c163af974f2bf738e6 | [log] [tgz] |
---|---|---|
author | Heschi Kreinick <heschi@google.com> | Tue Dec 18 14:53:56 2018 -0500 |
committer | Heschi Kreinick <heschi@google.com> | Tue Dec 18 20:40:10 2018 +0000 |
tree | 2b6a38ea682df9f032f9254fcad4f1c95213e356 | |
parent | bbbd9518e88c8c9d74d2b0f29f0d19b3b22338a1 [diff] |
imports: don't remove imports that conflict with globals 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>
This subrepository holds the source for various packages and tools that support the Go programming language.
Some of the tools, godoc
and vet
for example, are included in binary Go distributions.
Others, including the Go guru
and the test coverage tool, can be fetched with go get
.
Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.
The easiest way to install is to run go get -u golang.org/x/tools/...
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/tools
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.