gorf icon indicating copy to clipboard operation
gorf copied to clipboard

Refactoring tool for golang

THIS PRODUCT IS IN BETA. THE AUTHOR TAKES NO RESPONSIBILITY FOR LOSS OF CODE. CREATE BACKUPS BEFORE USING.

That being said, gorf does make backups of any change made, and there is a system for rolling them back.

Usage: gorf [flags] commands: changes clear move [+] moveall merge pkg rename [.] scan undo flags -?=false: Print usage and quit -r=".": Local package root

Detailed command doc

gorf changes

  • List all the backed up changes that gorf has made in the past, where the one indexed by zero is the most recent.

gorf clear

  • Remove all gorf backups. Undos will not be possible after performing this action.

gorf move [+]

  • Move the package in the old path to the new path. If one or more names are specified, only the objects named will be moved to the new path, if possible (if it is not possible, nothing happens). Moving a type also moves methods with that type as its receiver.

gorf moveall

  • Move everything in the old path, including nested packages, to the corresponding place in the new path.

gorf merge

  • Merge the contents of the package in the old path into the new path.

gorf pkg

  • Rename a package (without changing its import path).

gorf rename [.]

  • Rename an object in the package specified. If the old name is prefixed by a type, for instance "gorf rename path T.X Y", the X field in type T will be renamed to Y.

gorf scan

  • Print out a representation of the ast for this package.

gorf undo

  • Undoes the change indexed by 0 in gorf changes, and decrements the index for all other changes.