labels: Fixing linting errors.
This commit is contained in:
@@ -22,12 +22,12 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Represents a selector.
|
||||
// Selector represents a label selector.
|
||||
type Selector interface {
|
||||
// Returns true if this selector matches the given set of labels.
|
||||
// Matches returns true if this selector matches the given set of labels.
|
||||
Matches(Labels) bool
|
||||
|
||||
// Prints a human readable version of this selector.
|
||||
// String returns a human readable string that represents this selector.
|
||||
String() string
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func try(selectorPiece, op string) (lhs, rhs string, ok bool) {
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
// Given a Set, return a Selector which will match exactly that Set.
|
||||
// SelectorFromSet converts a Set into a Selector.
|
||||
func SelectorFromSet(ls Set) Selector {
|
||||
var items []Selector
|
||||
for label, value := range ls {
|
||||
@@ -99,7 +99,8 @@ func SelectorFromSet(ls Set) Selector {
|
||||
return andTerm(items)
|
||||
}
|
||||
|
||||
// Takes a string repsenting a selector and returns an object suitable for matching, or an error.
|
||||
// ParseSelector takes a string repsenting a selector and returns an
|
||||
// object suitable for matching, or an error.
|
||||
func ParseSelector(selector string) (Selector, error) {
|
||||
parts := strings.Split(selector, ",")
|
||||
sort.StringSlice(parts).Sort()
|
||||
|
Reference in New Issue
Block a user