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.
gotrace_id/context_test.go

19 lines
363 B

2 years ago
package gotrace_id
import (
2 years ago
"context"
2 years ago
"testing"
)
func TestContext(t *testing.T) {
2 years ago
ctx1 := CustomTraceIdContext(context.Background())
2 years ago
t.Log(ctx1)
t.Log(GetTraceIdContext(ctx1))
ctx2 := context.Background()
t.Log(ctx2)
t.Log(GetTraceIdContext(ctx2))
2 months ago
ctx3 := SetCustomTraceId(context.Background(), "23456")
t.Log(ctx3)
t.Log(GetTraceIdContext(ctx3))
2 years ago
}