-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxdgbasedir_unix.go
49 lines (38 loc) · 1.06 KB
/
xdgbasedir_unix.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
// Copyright 2017 The go-xdgbasedir Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !darwin
// +build !windows
package xdgbasedir
import (
"os"
"path/filepath"
"strconv"
"github.com/zchee/go-xdgbasedir/home"
)
var (
defaultDataHome = filepath.Join(home.Dir(), ".local", "share")
defaultConfigHome = filepath.Join(home.Dir(), ".config")
defaultDataDirs = filepath.Join("/usr", "local", "share") + string(filepath.ListSeparator) + filepath.Join("/usr", "share")
defaultConfigDirs = filepath.Join("/etc", "xdg")
defaultCacheHome = filepath.Join(home.Dir(), ".cache")
defaultRuntimeDir = filepath.Join("/run", "user", strconv.Itoa(os.Getuid()))
)
func dataHome() string {
return defaultDataHome
}
func configHome() string {
return defaultConfigHome
}
func dataDirs() string {
return defaultDataDirs
}
func configDirs() string {
return defaultConfigDirs
}
func cacheHome() string {
return defaultCacheHome
}
func runtimeDir() string {
return defaultRuntimeDir
}