updates #207

Merged
vtolstov merged 293 commits from updates into v3 2023-03-24 00:29:35 +03:00
189 changed files with 7929 additions and 3812 deletions
Showing only changes of commit 19b04fe070 - Show all commits

View File

@@ -67,6 +67,22 @@ func (md Metadata) Iterator() *Iterator {
return iter
}
func (md Metadata) MustGet(key string) string {
// fast path
val, ok := md[key]
if !ok {
// slow path
val, ok = md[textproto.CanonicalMIMEHeaderKey(key)]
if !ok {
val, ok = md[strings.ToLower(key)]
}
}
if !ok {
panic("missing metadata key")
}
return val
}
// Get returns value from metadata by key
func (md Metadata) Get(key string) (string, bool) {
// fast path