specifying a different source package
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 692
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
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'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rf command syntax and the code-address behavior described in the issue, using the example go.mod, p.go, and a/a.go files as the reproduction. Determine how a command such as mv A B selects its source package and how the proposed example.com/p/a:A form should work. Done means a single invocation can refactor symbols in a different package without changing directories or repeatedly loading the codebase.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100