mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
labels: Fixing linting errors.
This commit is contained in:
@@ -26,11 +26,11 @@ type Labels interface {
|
||||
Get(label string) (value string)
|
||||
}
|
||||
|
||||
// A map of label:value. Implements Labels.
|
||||
// Set is a map of label:value. Implements Labels.
|
||||
type Set map[string]string
|
||||
|
||||
// All labels listed as a human readable string. Conveniently, exactly the format
|
||||
// that ParseSelector takes.
|
||||
// String returns all labels listed as a human readable string.
|
||||
// Conveniently, exactly the format that ParseSelector takes.
|
||||
func (ls Set) String() string {
|
||||
selector := make([]string, 0, len(ls))
|
||||
for key, value := range ls {
|
||||
@@ -41,12 +41,12 @@ func (ls Set) String() string {
|
||||
return strings.Join(selector, ",")
|
||||
}
|
||||
|
||||
// Implement Labels interface.
|
||||
// Get returns the value for the provided label.
|
||||
func (ls Set) Get(label string) string {
|
||||
return ls[label]
|
||||
}
|
||||
|
||||
// Convenience function: convert these labels to a selector.
|
||||
// AsSelector converts labels into a selectors.
|
||||
func (ls Set) AsSelector() Selector {
|
||||
return SelectorFromSet(ls)
|
||||
}
|
||||
|
Reference in New Issue
Block a user