code: func splitPathOnSeparator(path string, separator rune) []string {
  	// if the separator is '\\', then we can just split...
  	if separator == '\\' {
  		return strings.Split(path, string(separator))
  	}
  
  	// otherwise, we need to be careful of situations where the separator was escaped
  	cnt := strings.Count(path, string(separator))
  	if cnt == 0 {
  		return []string{path}
  	}
  	ret := make([]string, cnt+1)
  	pathlen := len(path)
  	separatorLen := utf8.RuneLen(separator)
  	idx := 0
  	for start := 0; start < pathlen; {
  		end := indexRuneWithEscaping(path[start:], separator)
  		if end == -1 {
  			end = pathlen
  		} else {
  			end += start
  		}
  		ret[idx] = path[start:end]
  		start = end + separatorLen
  		idx++
  	}
  	return ret[:idx]
  }
docs: // Split a path on the given separator, respecting escaping.