attributeSuffixSelector returns a Selector that matches elements where the attribute named key ends with val.
(key, val string)
| 238 | // attributeSuffixSelector returns a Selector that matches elements where |
| 239 | // the attribute named key ends with val. |
| 240 | func attributeSuffixSelector(key, val string) Selector { |
| 241 | return attributeSelector(key, |
| 242 | func(s string) bool { |
| 243 | if strings.TrimSpace(s) == "" { |
| 244 | return false |
| 245 | } |
| 246 | return strings.HasSuffix(s, val) |
| 247 | }) |
| 248 | } |
| 249 | |
| 250 | // attributeSubstringSelector returns a Selector that matches nodes where |
| 251 | // the attribute named key contains val. |
no test coverage detected
searching dependent graphs…