code: func Span(path string, i, j int) (string, error) {
  	var f, l int
  	var ok bool
  
  	if i < 0 {
  		f, ok = segStartIndexFromEnd(path, i)
  	} else {
  		f, ok = segStartIndexFromStart(path, i)
  	}
  	if !ok {
  		return "", ErrFirstSegNotFound
  	}
  
  	if j > 0 {
  		l, ok = segEndIndexFromStart(path, j)
  	} else {
  		l, ok = segEndIndexFromEnd(path, j)
  	}
  	if !ok {
  		return "", ErrLastSegNotFound
  	}
  
  	if f == l {
  		return "", nil
  	}
  
  	if f > l {
  		return "", ErrSegOrderReversed
  	}
  
  	return path[f:l], nil
  }
docs: // Span returns the path segments between two segment indexes i and j including
  // the first segment. If an index is negative, the negative count begins with
  // the last segment. Providing a 0 for the last index j is a special case which
  // acts as an alias for the end of the path. If the first segment does not begin
  // with a slash and it is part of the requested span, no slash will be added. An
  // error is returned if: 1. Either index is out of range of the path; 2. The
  // first index i does not precede the last index j.