package main

import (
	"context"
	"fmt"
)

func main() {
	// Add the value of "42" with the key of "id"
	// section: set
	ctx := context.WithValue(context.Background(), "id", 42)
	// section: set

	// Retrieve the value back out
	// section: retrieve
	id, ok := ctx.Value("id").(int)
	if !ok {
		fmt.Println("id not fount")
		return
	}
	fmt.Printf("id is %d\n", id)
	// section: retrieve
}
