labels: Fixing linting errors.

This commit is contained in:
Burcu Dogan
2014-07-10 22:07:05 -07:00
parent 628667a2b0
commit f4d989ae92
2 changed files with 11 additions and 10 deletions

View File

@@ -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)
}