attributeSubstringSelector returns a Selector that matches nodes where the attribute named key contains val.
(key, val string)
| 250 | // attributeSubstringSelector returns a Selector that matches nodes where |
| 251 | // the attribute named key contains val. |
| 252 | func attributeSubstringSelector(key, val string) Selector { |
| 253 | return attributeSelector(key, |
| 254 | func(s string) bool { |
| 255 | if strings.TrimSpace(s) == "" { |
| 256 | return false |
| 257 | } |
| 258 | return strings.Contains(s, val) |
| 259 | }) |
| 260 | } |
| 261 | |
| 262 | // attributeRegexSelector returns a Selector that matches nodes where |
| 263 | // the attribute named key matches the regular expression rx |
no test coverage detected
searching dependent graphs…