From 97d26a6ec88da186f8cd38dd23b63a835c35a333 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 9 Mar 2024 23:45:36 +0300 Subject: [PATCH] metadata: add exclude to Copy func Signed-off-by: Vasiliy Tolstov --- metadata/metadata.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata/metadata.go b/metadata/metadata.go index 4718f420..bf7a8d3a 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -98,11 +98,12 @@ func (md Metadata) Del(keys ...string) { } // Copy makes a copy of the metadata -func Copy(md Metadata) Metadata { +func Copy(md Metadata, exclude ...string) Metadata { nmd := New(len(md)) for key, val := range md { nmd.Set(key, val) } + nmd.Del(exclude...) return nmd }