The rename tool is great, but be aware that it doesn't work if the compiler 
encounters even one error anywhere in the project. If the code is already 
complete and runs fine, rename works just fine, and is more selective than 
a blanket S&R. The rename tool parses the code into an AST, so it fully 
respects same identifiers that are not in the scope of the identifier you 
are trying to rename. This is a good thing, but just the code has to be 
100% compilable and there seems to be a number of linter conditions that 
block renaming, even if you can compile and run the code, even then.

I'd also suggest that you first want to draw a clear line around the code, 
separate it from the package it was in, to make the task easier before you 
start using rename.

go rename is very finicky, and I personally rarely find I can even use it, 
and just reach for the search and replace anyway.

On Friday, 3 May 2019 21:58:34 UTC+2, Tamás Gulácsi wrote:
>
> Rename the struct fields first, then move it to its own package.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to