You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
363 B
19 lines
363 B
package gotrace_id
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestContext(t *testing.T) {
|
|
ctx1 := CustomTraceIdContext(context.Background())
|
|
t.Log(ctx1)
|
|
t.Log(GetTraceIdContext(ctx1))
|
|
ctx2 := context.Background()
|
|
t.Log(ctx2)
|
|
t.Log(GetTraceIdContext(ctx2))
|
|
ctx3 := SetCustomTraceId(context.Background(), "23456")
|
|
t.Log(ctx3)
|
|
t.Log(GetTraceIdContext(ctx3))
|
|
}
|