fixup
Some checks failed
pr / test (pull_request) Failing after 2m44s
lint / lint (pull_request) Successful in 11m1s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-02-28 23:50:38 +03:00
parent 37fa3d6696
commit e6feca2fb1
2 changed files with 2 additions and 8 deletions

View File

@ -151,13 +151,7 @@ func ContentType(ct string) Option {
} }
// Metadata pass additional metadata // Metadata pass additional metadata
func Metadata(md metadata.Metadata) Option { func Metadata(md any) Option {
return func(src interface{}) error {
return Set(src, metadata.Copy(md), ".Metadata")
}
}
func MetadataAny(md any) Option {
result := metadata.Metadata{} result := metadata.Metadata{}
switch vt := md.(type) { switch vt := md.(type) {
case metadata.Metadata: case metadata.Metadata:

View File

@ -141,7 +141,7 @@ func TestMetadataAny(t *testing.T) {
t.Run(tt.Name, func(t *testing.T) { t.Run(tt.Name, func(t *testing.T) {
src := &s{} src := &s{}
var opts []options.Option var opts []options.Option
opts = append(opts, options.MetadataAny(tt.Data)) opts = append(opts, options.Metadata(tt.Data))
for _, o := range opts { for _, o := range opts {
if err := o(src); err != nil { if err := o(src); err != nil {
t.Fatal(err) t.Fatal(err)