(value []string)
| 18 | } |
| 19 | |
| 20 | func NewSelector(value []string) Selector { |
| 21 | negated := false |
| 22 | |
| 23 | parts := []string{} |
| 24 | for i, m := range value { |
| 25 | m = strings.TrimSpace(m) |
| 26 | if i == 0 && strings.HasPrefix(m, "~") { |
| 27 | m = strings.TrimPrefix(m, "~") |
| 28 | negated = true |
| 29 | } |
| 30 | parts = append(parts, m) |
| 31 | } |
| 32 | |
| 33 | return Selector{Value: parts, Negated: negated} |
| 34 | } |
| 35 | |
| 36 | func NewScope(value []string) Scope { |
| 37 | scope := map[string][]Selector{} |