1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:21:20 -06:00
go/src/cmd/gofmt
Robert Griesemer ff7ba773f4 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>
2016-04-06 18:19:33 +00:00
..
testdata cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports 2016-04-06 18:19:33 +00:00
doc.go gofmt/doc: gofmt -s output may not be backward compatible 2015-02-08 05:13:00 +00:00
gofmt_test.go all: use bytes.Equal, bytes.Contains and strings.Contains 2016-04-01 02:05:01 +00:00
gofmt.go cmd/gofmt: Ignore file not found errors. 2016-02-19 00:13:18 +00:00
internal.go all: single space after period. 2016-03-02 00:13:47 +00:00
long_test.go go/format, cmd/gofmt: avoid dependency on internal package format 2015-09-30 16:32:47 +00:00
rewrite.go all: single space after period. 2016-03-02 00:13:47 +00:00
simplify.go cmd/gofmt: make gofmt -s simplify slices in presence of dot-imports 2016-04-06 18:19:33 +00:00