mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-24 22:26:54 +02:00
add metadata set method (#1232)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@ -6,6 +6,18 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMetadataSet(t *testing.T) {
|
||||
ctx := Set(context.TODO(), "Key", "val")
|
||||
|
||||
val, ok := Get(ctx, "Key")
|
||||
if !ok {
|
||||
t.Fatal("key Key not found")
|
||||
}
|
||||
if val != "val" {
|
||||
t.Errorf("key Key with value val != %v", val)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMetadataCopy(t *testing.T) {
|
||||
md := Metadata{
|
||||
"Foo": "bar",
|
||||
|
Reference in New Issue
Block a user