Files
hugo/content/en/functions/path/Clean.md
T
2025-03-05 17:03:42 -08:00

759 B

title, description, categories, keywords, params, aliases
title description categories keywords params aliases
path.Clean Replaces path separators with slashes (`/`) and returns the shortest path name equivalent to the given path.
functions_and_methods
aliases returnType signatures
string
path.Clean PATH
/functions/path.clean

See Go's path.Clean documentation for details.

{{ path.Clean "foo/bar" }} → foo/bar
{{ path.Clean "/foo/bar" }} → /foo/bar
{{ path.Clean "/foo/bar/" }} → /foo/bar
{{ path.Clean "/foo//bar/" }} → /foo/bar
{{ path.Clean "/foo/./bar/" }} → /foo/bar
{{ path.Clean "/foo/../bar/" }} → /bar
{{ path.Clean "/../foo/../bar/" }} → /bar
{{ path.Clean "" }} → .