Skip to content

Instantly share code, notes, and snippets.

@tiborvass
Last active August 29, 2015 14:20
Show Gist options
  • Save tiborvass/583779b76e7a5f2b31a6 to your computer and use it in GitHub Desktop.
Save tiborvass/583779b76e7a5f2b31a6 to your computer and use it in GitHub Desktop.
Verifying copy/pastes of Go functions when refactoring
f=functionName; for x in '-' '+'; do git diff origin/pull/$PR^ origin/pull/$PR | awk '/^\'$x'func .* '$f'\(/,/^\'$x'[ '$'\t'']*\}/ { print }' | sed 's/^\'$x'//' > /tmp/$x; done; diff -u /tmp/{-,+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment