Skip to content

Instantly share code, notes, and snippets.

@judavi
Created June 5, 2020 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judavi/c4cbe017d944eca8eb80e4ec8ab8e0c1 to your computer and use it in GitHub Desktop.
Save judavi/c4cbe017d944eca8eb80e4ec8ab8e0c1 to your computer and use it in GitHub Desktop.
Log golang Db query?
package main
import (
"regexp"
"fmt"
"strings"
)
func main() {
var re = regexp.MustCompile(`:\d`)
var str = `hola :1 esto es :1 digito y otro :2 asdkj :4 `
for _, match := range re.FindAllString(str, -1) {
str= strings.Replace(str, match, `%s`, 1)
}
fmt.Println(str)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment