Skip to content

Commit

Permalink
Restore typedef for tag keys
Browse files Browse the repository at this point in the history
  • Loading branch information
liujed committed Aug 16, 2024
1 parent c65df0a commit 9abc4fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tags/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import (
"github.com/pkg/errors"
)

type Key = string
type Key string
type Value = string

// Maps tags to sets of values.
type Tags map[Key]ValueSet

// Sets the given key to the given values. Values are copied.
func (t Tags) Set(key string, values []string) {
func (t Tags) Set(key Key, values []string) {
t[key] = NewValueSet(values...)
}

// Sets the given key to the given value.
func (t Tags) SetSingleton(key string, value string) {
func (t Tags) SetSingleton(key Key, value string) {
t[key] = NewValueSet(value)
}

// Adds a value to the given key.
func (t Tags) Add(key string, value string) {
func (t Tags) Add(key Key, value string) {
if values, exists := t[key]; !exists {
t[key] = NewValueSet(value)
} else {
Expand Down

0 comments on commit 9abc4fe

Please sign in to comment.