1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-05 22:53:41 +02:00

Merge pull request #1269 from CryBecase/main

optimize Metadata init
This commit is contained in:
zwhyb 2021-07-28 14:21:14 +08:00 committed by GitHub
commit 352d6c8d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,13 +16,7 @@ func New(mds ...map[string]string) Metadata {
md := Metadata{}
for _, m := range mds {
for k, v := range m {
if k == "" {
continue
}
key := strings.ToLower(k)
if len(v) > 0 && v != "" {
md[key] = v
}
md.Set(k, v)
}
}
return md