Add Get method to Metas type

This commit is contained in:
Dan Jones 2026-02-01 11:29:04 -06:00
commit cccac79439
2 changed files with 26 additions and 0 deletions

View file

@ -69,3 +69,13 @@ func (ms *Metas) AppendTo(k string, v any) {
n := (*ms).Append(k, v)
*ms = n
}
// Returns the value of the Meta with the given key, and a bool indicating if it was found
func (ms Metas) Get(key string) (any, bool) {
for _, m := range ms {
if m.Key == key {
return m.Value, true
}
}
return nil, false
}