code: func (c *cancelCtx) cancel(removeFromParent bool, err error) {
  	if err == nil {
  		panic("context: internal error: missing cancel error")
  	}
  	c.mu.Lock()
  	if c.err != nil {
  		c.mu.Unlock()
  		return // already canceled
  	}
  	c.err = err
  	close(c.done)
  	for child := range c.children {
  		// NOTE: acquiring the child's lock while holding parent's lock.
  		child.cancel(false, err)
  	}
  	c.children = nil
  	c.mu.Unlock()
  
  	if removeFromParent {
  		removeChild(c.Context, c)
  	}
  }
docs: // cancel closes c.done, cancels each of c's children, and, if
  // removeFromParent is true, removes c from its parent's children.