Escape: only support utf-8
(sql string)
| 349 | |
| 350 | // Escape: only support utf-8 |
| 351 | func Escape(sql string) string { |
| 352 | dest := make([]byte, 0, 2*len(sql)) |
| 353 | |
| 354 | for _, w := range hack.Slice(sql) { |
| 355 | if c := EncodeMap[w]; c == DONTESCAPE { |
| 356 | dest = append(dest, w) |
| 357 | } else { |
| 358 | dest = append(dest, '\\', c) |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | return string(dest) |
| 363 | } |
| 364 | |
| 365 | func GetNetProto(addr string) string { |
| 366 | if strings.Contains(addr, "/") { |
nothing calls this directly
no outgoing calls
no test coverage detected