From e6feca2fb1014c42d6b1b200919fc12e2e2c9e6c Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 28 Feb 2024 23:50:38 +0300 Subject: [PATCH] fixup Signed-off-by: Vasiliy Tolstov --- options/options.go | 8 +------- options/options_test.go | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/options/options.go b/options/options.go index 5749c15e..226fd5e4 100644 --- a/options/options.go +++ b/options/options.go @@ -151,13 +151,7 @@ func ContentType(ct string) Option { } // Metadata pass additional metadata -func Metadata(md metadata.Metadata) Option { - return func(src interface{}) error { - return Set(src, metadata.Copy(md), ".Metadata") - } -} - -func MetadataAny(md any) Option { +func Metadata(md any) Option { result := metadata.Metadata{} switch vt := md.(type) { case metadata.Metadata: diff --git a/options/options_test.go b/options/options_test.go index c4b3677c..1bb0ce23 100644 --- a/options/options_test.go +++ b/options/options_test.go @@ -141,7 +141,7 @@ func TestMetadataAny(t *testing.T) { t.Run(tt.Name, func(t *testing.T) { src := &s{} var opts []options.Option - opts = append(opts, options.MetadataAny(tt.Data)) + opts = append(opts, options.Metadata(tt.Data)) for _, o := range opts { if err := o(src); err != nil { t.Fatal(err)