gg

command module
v0.0.0-...-c705ecb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 18 Imported by: 0

README

gg - Go Git Grep

Go Git Grep is a small search and replace tool. It works like grep, but is able to replace in files, recursively.

Example

gg '^\s+(.+)\.Log\("level", "(.[^"]+)", ' $GOPATH/src/github.com/dominikschulz/ --exclude vendor/ --workers 20 --replace 'level.${2}(${1}).Log(' --eat-my-data
gg 'level.error\(' $GOPATH/src/github.com/dominikschulz/ --exclude vendor/ --workers 20 --replace 'level.Error(' --eat-my-data --post-proc 'goimports -w'

FAQ

  • Similar tools: grep, ack, the silver searcher, ripgrep
  • Should I use this tool? - Probably not. Use ripgrep or your fancy IDE.
  • Will this tool destroy my data? - Probably yes. At least if you play around with --eat-my-data and --who-needs-backups
  • Seriously? Yes. You should know what you do.
  • Why did you write it then? Because I wanted recursive search and replace, with git support, on Unix platforms without overloaded IDEs.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL