func Base(path string) string {
	if path == "" {
		return "."
	}
	// Strip trailing slashes.
	for len(path) > 0 && path[len(path)-1] == '/' {
		path = path[0 : len(path)-1]
	}
	// Find the last element
	if i := lastSlash(path); i >= 0 {
		path = path[i+1:]
	}
	// If empty now, it had only slashes.
	if path == "" {
		return "/"
	}
	return path
}
// Base returns the last element of path.
// Trailing slashes are removed before extracting the last element.
// If the path is empty, Base returns ".".
// If the path consists entirely of slashes, Base returns "/".
Base returns the last element of path.
Trailing slashes are removed before extracting the last element.
If the path is empty, Base returns ".".
If the path consists entirely of slashes, Base returns "/".
// Base returns the last element of path . // Trailing slashes are removed before extracting the last element . // If the path is empty Base returns " . " . // If the path consists entirely of slashes Base returns " / " .
func Base(path string) string {
	if path == "" {
		return "."
	}
	for len(path) > 0 && path[len(path)-1] == '/' {
		path = path[0 : len(path)-1]
	}
	if i := lastSlash(path); i >= 0 {
		path = path[i+1:]
	}
	if path == "" {
		return "/"
	}
	return path
}
func Base ( path string ) string { if path == " " { return " " } for len ( path ) > 0 && path [ len ( path ) - 1 ] == '/' { path = path [ 0 : len ( path ) - 1 ] } if i := lastSlash ( path ) ; i >= 0 { path = path [ i + 1 : ] } if path == " " { return " " } return path }
Base returns the last element of path.
Base returns the last element of path .
// Strip trailing slashes. // Find the last element // If empty now, it had only slashes.