Path functions
Use these functions to work with file paths.
Use these functions to work with file paths.
path.Base PATH ⟼ stringReplaces path separators with slashes (
/
) and returns the last element of the given path.
Read More »
path.BaseName PATH ⟼ stringReplaces path separators with slashes (
/
) and returns the last element of the given path, removing the extension if present.
Read More »
path.Clean PATH ⟼ stringReplaces path separators with slashes (
/
) and returns the shortest path name equivalent to the given path.
Read More »
path.Dir PATH ⟼ stringReplaces path separators with slashes (/) and returns all but the last element of the given path. Read More »
path.Ext PATH ⟼ stringReplaces path separators with slashes (
/
) and returns the file name extension of the given path.
Read More »
path.Join ELEMENT... ⟼ stringReplaces path separators with slashes (
/
), joins the given path elements into a single path, and returns the shortest path name equivalent to the result.
Read More »
path.Split PATH ⟼ paths.DirFileReplaces path separators with slashes (
/
) and splits the resulting path immediately following the final slash, separating it into a directory and file name component.
Read More »