func (ctx *ContextTree) GetOK(key interface{}) (interface{}, bool) {
	ctx.m.RLock()
	defer ctx.m.RUnlock()
	if ctx.aliased != nil {
		return ctx.aliased.GetOK(key)
	}
	val, ok := ctx.data[key]
	return val, ok
}
GetOK returns the value associated with the given key, along with a
bool value indicating successful lookup. See Get for details.
package scope
import (
	"errors"
	"sync"
	"time"
)
var (
	Cancelled = errors.New("context cancelled")
	Canceled  = Cancelled
	TimedOut = errors.New("context timed out")
)
type Context interface {
	Alive() bool
	Done() <-chan struct{}
	Err() error
	Cancel()
	Terminate(error)
	Fork() Context
	ForkWithTimeout(time.Duration) Context
	Get(key interface{}) interface{}
	GetOK(key interface{}) (interface{}, bool)
	Set(key, val interface{})
	WaitGroup() *sync.WaitGroup
	Breakpointer
}
type builtinKey int
const (
	bpmapKey builtinKey = iota
)
type kvmap map[interface{}]interface{}
func New() Context {
	ctx := &ContextTree{
		wg:       &sync.WaitGroup{},
		done:     make(chan struct{}),
		data:     kvmap{},
		children: map[*ContextTree]struct{}{},
	}
	ctx.Set(bpmapKey, bpmap{})
	return ctx
}
type ContextTree struct {
	wg       *sync.WaitGroup
	m        sync.RWMutex
	termed   bool
	done     chan struct{}
	err      error
	data     kvmap
	aliased  *ContextTree
	children map[*ContextTree]struct{}
}
func (ctx *ContextTree) WaitGroup() *sync.WaitGroup { return ctx.wg }
func (ctx *ContextTree) Alive() bool { return !ctx.termed }
func (ctx *ContextTree) Done() <-chan struct{} { return ctx.done }
func (ctx *ContextTree) Err() error { return ctx.err }
func (ctx *ContextTree) Cancel() { ctx.Terminate(Cancelled) }
func (ctx *ContextTree) Terminate(err error) {
	ctx.m.Lock()
	ctx.terminate(err)
	ctx.m.Unlock()
}
func (ctx *ContextTree) terminate(err error) {
	if ctx.Alive() {
		ctx.termed = true
		ctx.err = err
		for child := range ctx.children {
			child.m.Lock()
			child.terminate(err)
			child.m.Unlock()
		}
		close(ctx.done)
	}
}
func (ctx *ContextTree) Fork() Context {
	ctx.m.Lock()
	defer ctx.m.Unlock()
	child := &ContextTree{
		wg:       ctx.wg,
		done:     make(chan struct{}),
		children: map[*ContextTree]struct{}{},
	}
	if ctx.aliased == nil {
		child.aliased = ctx
	} else {
		child.aliased = ctx.aliased
	}
	ctx.children[child] = struct{}{}
	return child
}
func (ctx *ContextTree) ForkWithTimeout(dur time.Duration) Context {
	timer := time.NewTimer(dur)
	child := ctx.Fork()
	go func() {
		select {
		case <-child.Done():
			timer.Stop()
		case <-timer.C:
			child.Terminate(TimedOut)
		}
	}()
	return child
}
func (ctx *ContextTree) Get(key interface{}) interface{} {
	val, _ := ctx.GetOK(key)
	return val
}