ctx := context.Background() value := "foo" ctx = context.WithValue(ctx, "my_key", value)
ctx := context.Background() value := ctx.Value("my_key") if value != nil { // do something with the value }In these examples, we're creating a new context using the `context.Background()` function, and then attaching a value to it using the `WithValue` method. We're using the key "my_key" to identify the value. Later, we can retrieve the value from the context using the same key. Overall, the `github.com.pingcap.tidb.context` package library provides a simple and convenient way to pass values between different parts of your application using contexts.