Editor modes that invoke the goimports command on temporary copies of actual source files will need to invoke goimports -srcdir now to say where the real source directory is. Otherwise goimports will not consider vendored or internal packages when looking for new imports. In lieu of a test for cmd/goimports (because it has no tests), a command transcript: $ cd /tmp $ cat x.go package p var _ = hpack.HuffmanDecode $ $ GOPATH= goimports < x.go package p var _ = hpack.HuffmanDecode $ GOPATH= goimports x.go package p var _ = hpack.HuffmanDecode $ But with the new flag: $ GOPATH= goimports -srcdir $GOROOT/src/math < x.go package p import "golang.org/x/net/http2/hpack" var _ = hpack.HuffmanDecode $ GOPATH= goimports -srcdir $GOROOT/src/math x.go package p import "golang.org/x/net/http2/hpack" var _ = hpack.HuffmanDecode $ The tests in this CL and the above transcript assume that $GOROOT/src/vendor/golang.org/x/net/http2/hpack exists. It did in 40a26c9, but it does not today. It will again soon (once Go 1.7 opens). For golang/go#12278 (original request). Change-Id: I27b136041f54edcde4bf474215b48ebb0417f34d Reviewed-on: https://go-review.googlesource.com/17728 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> |
||
|---|---|---|
| benchmark/parse | ||
| blog | ||
| cmd | ||
| container/intsets | ||
| cover | ||
| go | ||
| godoc | ||
| imports | ||
| oracle | ||
| playground | ||
| present | ||
| refactor | ||
| .gitattributes | ||
| .gitignore | ||
| AUTHORS | ||
| CONTRIBUTING.md | ||
| CONTRIBUTORS | ||
| LICENSE | ||
| PATENTS | ||
| README | ||
| codereview.cfg | ||
README
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 oracle 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. To submit changes to this repository, see http://golang.org/doc/contribute.html.