--------------------------------------------------------------------------- helpers --------------------------------------------------------------------------- containsAny reports whether s contains any of the given substrings using a case-insensitive comparison. Both s and each element of substrs
(s string, substrs ...string)
| 436 | // containsAny("LIMIT clause not supported", "limit", "SQL Server") // true |
| 437 | // containsAny("unknown dialect", "TOP", "FETCH") // false |
| 438 | func containsAny(s string, substrs ...string) bool { |
| 439 | lower := strings.ToLower(s) |
| 440 | for _, sub := range substrs { |
| 441 | if strings.Contains(lower, strings.ToLower(sub)) { |
| 442 | return true |
| 443 | } |
| 444 | } |
| 445 | return false |
| 446 | } |
no outgoing calls
no test coverage detected