mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-18 12:42:19 +00:00
22 lines
363 B
Go
22 lines
363 B
Go
package utils
|
|
|
|
type SeenMap map[string]string
|
|
|
|
func (seen SeenMap) Seen(item string) bool {
|
|
_, ok := seen[item]
|
|
return ok
|
|
}
|
|
|
|
func (seen SeenMap) Set(k, v string) {
|
|
seen[k] = v
|
|
}
|
|
|
|
// The caller should make sure that key is in the map.
|
|
func (seen SeenMap) Value(k string) string {
|
|
return seen[k]
|
|
}
|
|
|
|
func NewSeenMap() SeenMap {
|
|
return make(map[string]string)
|
|
}
|