metadata: allow to remove key from metadata (#1453)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -18,6 +18,27 @@ func TestMetadataSet(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMetadataDel(t *testing.T) {
|
||||
md := Metadata{
|
||||
"Foo": "bar",
|
||||
"Baz": "empty",
|
||||
}
|
||||
|
||||
ctx := NewContext(context.TODO(), md)
|
||||
ctx = Set(ctx, "Baz", "")
|
||||
|
||||
emd, ok := FromContext(ctx)
|
||||
if !ok {
|
||||
t.Fatal("key Key not found")
|
||||
}
|
||||
|
||||
_, ok = emd["Baz"]
|
||||
if ok {
|
||||
t.Fatal("key Baz not deleted")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestMetadataCopy(t *testing.T) {
|
||||
md := Metadata{
|
||||
"Foo": "bar",
|
||||
|
||||
Reference in New Issue
Block a user