Join, Dir, Base, Ext, Clean
path.Join("a", "b", "c") // "a/b/c"
path.Dir("a/b/c.txt") // "a/b"
path.Base("a/b/c.txt") // "c.txt"
path.Ext("c.tar.gz") // ".gz"
path.Clean("a//b/../c/") // "a/c"
pathSlash-separated path manipulation. For URLs and io/fs paths. NOT for OS files — use path/filepath for that.
path always uses /. path/filepath uses the OS separator (\ on Windows). URL paths, io/fs paths, and embed.FS keys are always forward slashes — use path for those. Local disk paths — use filepath.
path.Join("a", "b", "c") // "a/b/c"
path.Dir("a/b/c.txt") // "a/b"
path.Base("a/b/c.txt") // "c.txt"
path.Ext("c.tar.gz") // ".gz"
path.Clean("a//b/../c/") // "a/c"
ok, _ := path.Match("*.go", "main.go") // true
ok, _ = path.Match("*.go", "cmd/main.go") // false