Skip to content

Instantly share code, notes, and snippets.

View jrkt's full-sized avatar
🤟

Jonathan K. Stevens jrkt

🤟
View GitHub Profile
@jrkt
jrkt / refactor.go
Last active February 27, 2023 18:35
Go - recursive find and replace based on file patterns
package main
func main() {
err := Refactor("oldString", "newString", "*.txt", "*.json)
if err != nil {
// handle error
}
}
func Refactor(old, new string, patterns ...string) error {