Permalink
Browse files

Introduce config_dir(), move both to os_ specific files.

Breaks windows build. Will be fixed in a moment.
  • Loading branch information...
1 parent cb4774c commit fc33e068b2f6a2daf6dd2c5ce09a242be9d7c9d3 @nsf committed Dec 26, 2012
Showing with 11 additions and 5 deletions.
  1. +1 −5 config.go
  2. +10 −0 os_posix.go
View
@@ -12,10 +12,6 @@ import (
"strconv"
)
-func config_file() string {
- return filepath.Join(xdg_home_dir(), "gocode", "config.json")
-}
-
//-------------------------------------------------------------------------
// config
//
@@ -135,7 +131,7 @@ func (this *config) write() error {
}
// make sure config dir exists
- dir := filepath.Join(xdg_home_dir(), "gocode")
+ dir := config_dir()
if !file_exists(dir) {
os.MkdirAll(dir, 0755)
}
View
@@ -36,3 +36,13 @@ func get_executable_filename() string {
}
return ""
}
+
+// config location
+
+func config_dir() string {
+ return filepath.Join(xdg_home_dir(), "gocode")
+}
+
+func config_file() string {
+ return filepath.Join(xdg_home_dir(), "gocode", "config.json")
+}

0 comments on commit fc33e06

Please sign in to comment.