fixup
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
37fa3d6696
commit
e6feca2fb1
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user