mirror of
https://github.com/SourceFellows/gobuch.git
synced 2024-10-22 13:57:13 +00:00
16 lines
215 B
Go
16 lines
215 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
type contextKey string
|
|
|
|
func main() {
|
|
var key contextKey = "test"
|
|
ctx := context.Background()
|
|
ctx = context.WithValue(ctx, key, "world")
|
|
fmt.Println(ctx.Value(key))
|
|
}
|