(expr string)
| 286 | } |
| 287 | |
| 288 | func stripOuterSQLParens(expr string) string { |
| 289 | trimmed := strings.TrimSpace(expr) |
| 290 | for len(trimmed) > 0 && trimmed[0] == '(' { |
| 291 | _, end, ok := scanBalancedParenthesizedSQL(trimmed, 0) |
| 292 | if !ok || end != len(trimmed) { |
| 293 | break |
| 294 | } |
| 295 | trimmed = strings.TrimSpace(trimmed[1 : len(trimmed)-1]) |
| 296 | } |
| 297 | return trimmed |
| 298 | } |
| 299 | |
| 300 | func scanBalancedParenthesizedSQL(sql string, start int) (string, int, bool) { |
| 301 | if start >= len(sql) || sql[start] != '(' { |
no test coverage detected