code: func PreserveTrailingDotOrSeparator(cleanedPath string, originalPath string, sep byte) string {
  	// Ensure paths are in platform semantics
  	cleanedPath = strings.Replace(cleanedPath, "/", string(sep), -1)
  	originalPath = strings.Replace(originalPath, "/", string(sep), -1)
  
  	if !specifiesCurrentDir(cleanedPath) && specifiesCurrentDir(originalPath) {
  		if !hasTrailingPathSeparator(cleanedPath, sep) {
  			// Add a separator if it doesn't already end with one (a cleaned
  			// path would only end in a separator if it is the root).
  			cleanedPath += string(sep)
  		}
  		cleanedPath += "."
  	}
  
  	if !hasTrailingPathSeparator(cleanedPath, sep) && hasTrailingPathSeparator(originalPath, sep) {
  		cleanedPath += string(sep)
  	}
  
  	return cleanedPath
  }
docs: // PreserveTrailingDotOrSeparator returns the given cleaned path (after
  // processing using any utility functions from the path or filepath stdlib
  // packages) and appends a trailing `/.` or `/` if its corresponding  original
  // path (from before being processed by utility functions from the path or
  // filepath stdlib packages) ends with a trailing `/.` or `/`. If the cleaned
  // path already ends in a `.` path segment, then another is not added. If the
  // clean path already ends in the separator, then another is not added.