top | item 8643461

Gorename: easy refactoring tool for Golang

52 points| vruiz | 11 years ago |texlution.com | reply

15 comments

order
[+] lazyjones|11 years ago|reply
Note that Go comes with a powerful refactoring tool "out of the box":

http://golang.org/cmd/gofmt/

It allows easy renaming of variables, constants etc.

[+] pjmlp|11 years ago|reply
Does it also extract methods, convert fields into accessors, move code between packages while updating import statements, update comments that relate to code, move methods across types?

Renaming is only Refactoring 101.

[+] tmrmn|11 years ago|reply
at first i've read it as 'gore-name'... not the nicest thing
[+] scarboy|11 years ago|reply
It's no expertsexchange. I wouldn't bother changing it.
[+] fidz|11 years ago|reply
It should GoRename. or go-rename. or something that everyone can obviously distinguish it.
[+] Kapura|11 years ago|reply
I think GoreName should be the canonical pronunciation simply because it's more fun.
[+] Twirrim|11 years ago|reply
Yup. Took me a moment or two to even realise what its real name was
[+] Dylan16807|11 years ago|reply
So how about the objections in https://news.ycombinator.com/item?id=8579893
[+] AYBABTME|11 years ago|reply
This person is just wrong. It's not because the tools weren't there or the commenter was unaware of how they work, that Go is bad at refactoring. It's very easy to write correct, type safe refactoring tools on Go code.
[+] nl|11 years ago|reply
Now for IDE integration. Please!
[+] jdfellow|11 years ago|reply
vim-go integrates with it already. Put your cursor on a name, type :GoRename, et voila all other instances across your project are updated.
[+] dawkins|11 years ago|reply
in liteIde press ctrl+shift+r to rename. ctrl+shift+u to find where is used. I don't think it uses gorename though.