code: func (t *tx) EndSegment() error {
  	t.mtx.Lock()
  	defer t.mtx.Unlock()
  
  	if id, ok := t.ss.Pop(); ok {
  		return t.Tracer.EndSegment(t.id, id)
  	}
  	return nil
  }
docs: // EndSegment ends the segment at the top of the stack.