Skip to content

Commit fc33e06

Browse files
committed
Introduce config_dir(), move both to os_ specific files.
Breaks windows build. Will be fixed in a moment.
1 parent cb4774c commit fc33e06

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

config.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import (
1212
"strconv"
1313
)
1414

15-
func config_file() string {
16-
return filepath.Join(xdg_home_dir(), "gocode", "config.json")
17-
}
18-
1915
//-------------------------------------------------------------------------
2016
// config
2117
//
@@ -135,7 +131,7 @@ func (this *config) write() error {
135131
}
136132

137133
// make sure config dir exists
138-
dir := filepath.Join(xdg_home_dir(), "gocode")
134+
dir := config_dir()
139135
if !file_exists(dir) {
140136
os.MkdirAll(dir, 0755)
141137
}

os_posix.go

+10
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ func get_executable_filename() string {
3636
}
3737
return ""
3838
}
39+
40+
// config location
41+
42+
func config_dir() string {
43+
return filepath.Join(xdg_home_dir(), "gocode")
44+
}
45+
46+
func config_file() string {
47+
return filepath.Join(xdg_home_dir(), "gocode", "config.json")
48+
}

0 commit comments

Comments
 (0)