Skip to content

Instantly share code, notes, and snippets.

View hidori's full-sized avatar
🏠
Working from home

Hiroaki SHIBUKI hidori

🏠
Working from home
  • Tokyo, Japan
  • 08:12 (UTC +09:00)
View GitHub Profile
func Escape(sql string) string {
dest := make([]byte, 0, 2*len(sql))
var escape byte
for i := 0; i < len(sql); i++ {
c := sql[i]
escape = 0
switch c {
case 0: /* Must be escaped for 'mysql' */