dont overwrite metadata
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
6dbd6e27e4
commit
4cb50e8692
10
requestid.go
10
requestid.go
@ -19,12 +19,12 @@ var (
|
||||
// MetadataFunc wil be used if user not provide own func to fill metadata
|
||||
MetadataFunc = func(ctx context.Context) (context.Context, error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if ok {
|
||||
if _, ok = md.Get(MetadataKey); ok {
|
||||
return ctx, nil
|
||||
}
|
||||
if !ok {
|
||||
md = metadata.New(1)
|
||||
}
|
||||
if _, ok = md.Get(MetadataKey); ok {
|
||||
return ctx, nil
|
||||
}
|
||||
md = metadata.New(1)
|
||||
id, err := uuid.NewRandom()
|
||||
if err != nil {
|
||||
return ctx, err
|
||||
|
Loading…
x
Reference in New Issue
Block a user