Roll back my two recent changes. Stringer is now very slow again,
but works in most use cases.
My git foo is insufficient to do this as a revert, but it is a by-hand
reversion of CLs
https://go-review.googlesource.com/121884https://go-review.googlesource.com/121995
See the issue for a long conversation about the general problem.
Update golang/go#10249
Update golang/go#25650
Change-Id: I7b6ce352a4c7ebf0977883509e9d7189aaac1251
Reviewed-on: https://go-review.googlesource.com/122535
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Revert "cmd/stringer: use source importer when available"
This reverts CL 40403.
The idea is to avoid type-checking and use just parsing, which should be
enough for stringer.
Separately reopening golang/go#10249 because the original change closed that issue,
but the change is itself causing other problems as described in the discussion
at golang/go#25650.
This reversion restores the old behavior of stringer and will be followed
with other fixes if they can be worked out.
Change-Id: I8404d78da08043ede1a36b0e135a3fc7fdf6728d
Reviewed-on: https://go-review.googlesource.com/121884
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This means that running stringer should always
have the intended effect, without having to
go install the package first, which was a common
source of confusion.
The source importer is marginally slower,
but stringer is run infrequently,
and we're only typechecking one package (and fmt),
not an entire tree, as vet does.
Fixesgolang/go#10249
Change-Id: Ib8cde29bd6cc596964dbe7348065932dd59075fc
Reviewed-on: https://go-review.googlesource.com/40403
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Robert Griesemer <gri@golang.org>