Lines Matching refs:filepath

2 title: filepath functions
10 - `filepath`, which should be used for local filesystem paths, especially when Windows paths may be…
12 This page documents the `filepath` namespace - see also the [`path`](../path) documentation.
14 These functions are wrappers for Go's [`path/filepath`](https://golang.org/pkg/path/filepath/) pack…
16 ## `filepath.Base`
20 A wrapper for Go's [`filepath.Base`](https://golang.org/pkg/path/filepath/#Base) function.
25 filepath.Base path
28 path | filepath.Base
40 $ gomplate -i '{{ filepath.Base "/tmp/foo" }}'
44 ## `filepath.Clean`
48 A wrapper for Go's [`filepath.Clean`](https://golang.org/pkg/path/filepath/#Clean) function.
53 filepath.Clean path
56 path | filepath.Clean
68 $ gomplate -i '{{ filepath.Clean "/tmp//foo/../" }}'
72 ## `filepath.Dir`
76 A wrapper for Go's [`filepath.Dir`](https://golang.org/pkg/path/filepath/#Dir) function.
81 filepath.Dir path
84 path | filepath.Dir
96 $ gomplate -i '{{ filepath.Dir "/tmp/foo" }}'
100 ## `filepath.Ext`
104 A wrapper for Go's [`filepath.Ext`](https://golang.org/pkg/path/filepath/#Ext) function.
109 filepath.Ext path
112 path | filepath.Ext
124 $ gomplate -i '{{ filepath.Ext "/tmp/foo.csv" }}'
128 ## `filepath.FromSlash`
132 A wrapper for Go's [`filepath.FromSlash`](https://golang.org/pkg/path/filepath/#FromSlash) function.
137 filepath.FromSlash path
140 path | filepath.FromSlash
152 $ gomplate -i '{{ filepath.FromSlash "/foo/bar" }}'
154 C:\> gomplate.exe -i '{{ filepath.FromSlash "/foo/bar" }}'
158 ## `filepath.IsAbs`
162 A wrapper for Go's [`filepath.IsAbs`](https://golang.org/pkg/path/filepath/#IsAbs) function.
167 filepath.IsAbs path
170 path | filepath.IsAbs
182 $ gomplate -i 'the path is {{ if (filepath.IsAbs "/tmp/foo.csv") }}absolute{{else}}relative{{end}}'
184 $ gomplate -i 'the path is {{ if (filepath.IsAbs "../foo.csv") }}absolute{{else}}relative{{end}}'
188 ## `filepath.Join`
192 A wrapper for Go's [`filepath.Join`](https://golang.org/pkg/path/filepath/#Join) function.
197 filepath.Join elem...
209 $ gomplate -i '{{ filepath.Join "/tmp" "foo" "bar" }}'
211 C:\> gomplate.exe -i '{{ filepath.Join "C:\tmp" "foo" "bar" }}'
215 ## `filepath.Match`
219 A wrapper for Go's [`filepath.Match`](https://golang.org/pkg/path/filepath/#Match) function.
224 filepath.Match pattern path
237 $ gomplate -i '{{ filepath.Match "*.csv" "foo.csv" }}'
241 ## `filepath.Rel`
245 A wrapper for Go's [`filepath.Rel`](https://golang.org/pkg/path/filepath/#Rel) function.
250 filepath.Rel basepath targetpath
263 $ gomplate -i '{{ filepath.Rel "/a" "/a/b/c" }}'
267 ## `filepath.Split`
273 A wrapper for Go's [`filepath.Split`](https://golang.org/pkg/path/filepath/#Split) function.
278 filepath.Split path
281 path | filepath.Split
293 $ gomplate -i '{{ $p := filepath.Split "/tmp/foo" }}{{ $dir := index $p 0 }}{{ $file := index $p 1 …
295 C:\> gomplate.exe -i '{{ $p := filepath.Split `C:\tmp\foo` }}{{ $dir := index $p 0 }}{{ $file := in…
299 ## `filepath.ToSlash`
303 A wrapper for Go's [`filepath.ToSlash`](https://golang.org/pkg/path/filepath/#ToSlash) function.
308 filepath.ToSlash path
311 path | filepath.ToSlash
323 $ gomplate -i '{{ filepath.ToSlash "/foo/bar" }}'
325 C:\> gomplate.exe -i '{{ filepath.ToSlash `foo\bar\baz` }}'
329 ## `filepath.VolumeName`
333 A wrapper for Go's [`filepath.VolumeName`](https://golang.org/pkg/path/filepath/#VolumeName) functi…
338 filepath.VolumeName path
341 path | filepath.VolumeName
353 C:\> gomplate.exe -i 'volume is {{ filepath.VolumeName "C:/foo/bar" }}'
355 $ gomplate -i 'volume is {{ filepath.VolumeName "/foo/bar" }}'