Debian Codegraph @

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

raw
1 ---
2 title: path.Dir
3 description: Replaces path separators with slashes (/) and returns all but the last element of the given path.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: []
9 returnType: string
10 signatures: [path.Dir PATH]
11 aliases: [/functions/path.dir]
12 ---
13
14 ```go-html-template
15 {{ path.Dir "a/news.html" }} → a
16 {{ path.Dir "news.html" }} → .
17 {{ path.Dir "a/b/c" }} → a/b
18 {{ path.Dir "/a/b/c" }} → /a/b
19 {{ path.Dir "/a/b/c/" }} → /a/b/c
20 {{ path.Dir "" }} → .
21 ```