package handler type ContextKey[T any] string type Context map[string]any func GetContextValue[T any](ctx Context, key ContextKey[T]) T { value, present := ctx[string(key)] if !present { var zero T return zero } typedValue, _ := value.(T) return typedValue } func SetContextValue[T any](ctx Context, key ContextKey[T], value T) { ctx[string(key)] = value }