rf
rf copied to clipboard
specifying a different source package
I haven't found a way to specify a different source package than the current one when invoking commands like mv A B. I'm working around this limitation by calling rf in a shell script that changes the working directory before invoking it. In a large codebase, each invocation of rf requires about 15-30 seconds to load everything before it does any refactoring. In my case, I wanted to rename structs in 130 packages and this took over an hour.
Example:
go.mod
module example.com/p
go 1.16
p.go
package p
var nothing string
a/a.go
package a
var A int
If I understand code addresses correctly, I would expect to be able to write something like this:
rf 'mv example.com/p/a:A A'