1
0
mirror of https://github.com/golang/go synced 2024-10-01 12:48:33 -06:00
Commit Graph

6 Commits

Author SHA1 Message Date
Alan Donovan
c1ef9c75bf cmd/gorename: make Usage documentation sensible in godoc
Fixes golang/go#9469

Change-Id: I74e19e3d095e4c2ab62f755a408f58fd5e7ac2f2
Reviewed-on: https://go-review.googlesource.com/2176
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2014-12-30 16:36:43 +00:00
Alan Donovan
0ae83e44ba refactor/rename: add missing operand to fmt.Errorf
TBR=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/177920043
2014-11-17 12:17:16 -05:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Alan Donovan
d73c11bfcb refactor/rename: make -from syntax support string literals for complex import paths.
(They may contain any character, after all.)

Also, allow but don't require parens and stars.
e.g. (*"encoding/json".Decoder).Decode or "encoding/json".Decoder.Decode
     but not encoding/json.Decoder.Decode.

Since -from queries are now Go expressions, we use the Go parser.
(Thanks to Rog Peppe for the suggestion.)

LGTM=sameer
R=sameer
CC=golang-codereviews, gri, rogpeppe
https://golang.org/cl/154610043
2014-10-31 15:39:22 -04:00
Alan Donovan
a69ece7231 refactor/rename: attempt to fix windows build...
...by using buildutil.ContainingPackage instead of guessImportPath.
The former should be more portable.

(I meant to do this earlier, so this is also a nice cleanup.)

LGTM=gri
R=gri, sameer
CC=golang-codereviews
https://golang.org/cl/148050043
2014-09-24 16:18:58 -04:00
Alan Donovan
74021b4175 cmd/gorename: a precise, type-aware renaming tool for Go identifiers.
See the usage message in main.go for orientation.

To the best of my knowledge, the tool implements all required
soundness checks, except:
- the dynamic behaviour of reflection is obviously undecidable.
- it rejects method renamings that change the "implements" relation.
  It should probably be more aggressive.
- actually it only checks the part of the "implements" relation
  needed for compilation.  Understanding the dynamic behaviour
  of interfaces is obviously undecidable.
- a couple of minor gaps are indicated by TODO comments.

Also:
- Emacs integration.
- tests of all safety checks and (some) successful rewrites.

LGTM=dominik.honnef, sameer
R=gri, sameer, dominik.honnef
CC=golang-codereviews
https://golang.org/cl/139150044
2014-09-23 10:23:04 -04:00