]> Cypherpunks repositories - gostls13.git/commit
cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports
authorRobert Griesemer <gri@golang.org>
Wed, 6 Apr 2016 17:49:12 +0000 (10:49 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 6 Apr 2016 18:19:33 +0000 (18:19 +0000)
commitff7ba773f43bf04c34ffb6ed67da464072e476f7
tree74c454b64ea5c6f4100fd32322be2463017ca10b
parentd7ddee78ddca805e6609149ff4320b1547698259
cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports

A dot-import cannot possibly introduce a `len` function since that
function would not be exported (it's lowercase). Furthermore, the
existing code already (incorrectly) assumed that there was no other
`len` function in another file of the package. Since this has been
an ok assumption for years, let's leave it, but remove the dot-import
restriction.

Fixes #15153.

Change-Id: I18fbb27acc5a5668833b4b4aead0cca540862b52
Reviewed-on: https://go-review.googlesource.com/21613
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/gofmt/simplify.go
src/cmd/gofmt/testdata/slices2.golden [deleted file]
src/cmd/gofmt/testdata/slices2.input [deleted file]