-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_test.go
51 lines (41 loc) · 987 Bytes
/
example_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package xdg_test
import (
"fmt"
"github.com/mdm-code/xdg"
)
func ExampleDataHomeDir() {
dir := xdg.DataHomeDir()
fmt.Println("Home data directory: ", dir)
}
func ExampleConfigHomeDir() {
dir := xdg.ConfigHomeDir()
fmt.Println("Config home directory: ", dir)
}
func ExampleStateHomeDir() {
dir := xdg.StateHomeDir()
fmt.Println("State home directory: ", dir)
}
func ExampleDataDirs() {
dir := xdg.DataDirs()
fmt.Println("Data directories: ", dir)
}
func ExampleConfigDirs() {
dir := xdg.ConfigDirs()
fmt.Println("Config directories: ", dir)
}
func ExampleCacheHomeDir() {
dir := xdg.CacheHomeDir()
fmt.Println("Cache home directory: ", dir)
}
func ExampleRuntimeDir() {
dir := xdg.RuntimeDir()
fmt.Println("Runtime home directory: ", dir)
}
func ExampleFind() {
fpath := "program/file.data"
if f, ok := xdg.Find(xdg.Data, fpath); ok {
fmt.Printf("Data file for %s was found at %s\n", fpath, f)
} else {
fmt.Printf("ERROR: couldn't find %s\n", fpath)
}
}