Debian Codegraph @

docs/content/en/functions/path/Join.md

raw
1 ---
2 title: path.Join
3 description: Replaces path separators with slashes (`/`), joins the given path elements into a single path, and returns the shortest path name equivalent to the result.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: []
9 returnType: string
10 signatures: [path.Join ELEMENT...]
11 aliases: [/functions/path.join]
12 ---
13
14 See Go's [`path.Join`][] and [`path.Clean`][] documentation for details.
15
16 ```go-html-template
17 {{ path.Join "partial" "news.html" }} → partial/news.html
18 {{ path.Join "partial/" "news.html" }} → partial/news.html
19 {{ path.Join "foo/bar" "baz" }} → foo/bar/baz
20 {{ path.Join "foo" "bar" "baz" }} → foo/bar/baz
21 {{ path.Join "foo" "" "baz" }} → foo/baz
22 {{ path.Join "foo" "." "baz" }} → foo/baz
23 {{ path.Join "foo" ".." "baz" }} → baz
24 {{ path.Join "/.." "foo" ".." "baz" }} → baz
25 ```
26
27 [`path.Clean`]: https://pkg.go.dev/path#Clean
28 [`path.Join`]: https://pkg.go.dev/path#Join