aboutsummaryrefslogtreecommitdiff
path: root/core/assets
diff options
context:
space:
mode:
Diffstat (limited to 'core/assets')
-rw-r--r--core/assets/path.go29
-rw-r--r--core/assets/path_test.go12
2 files changed, 0 insertions, 41 deletions
diff --git a/core/assets/path.go b/core/assets/path.go
deleted file mode 100644
index abe4638d0..000000000
--- a/core/assets/path.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package assets
-
-import (
- "os"
- "path/filepath"
- "runtime"
-)
-
-// Path returns the path to the folder
-// where the application may store data. This
-// currently resolves to ~/.coredns
-func Path() string {
- return filepath.Join(userHomeDir(), ".coredns")
-}
-
-// userHomeDir returns the user's home directory according to
-// environment variables.
-//
-// Credit: http://stackoverflow.com/a/7922977/1048862
-func userHomeDir() string {
- if runtime.GOOS == "windows" {
- home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
- if home == "" {
- home = os.Getenv("USERPROFILE")
- }
- return home
- }
- return os.Getenv("HOME")
-}
diff --git a/core/assets/path_test.go b/core/assets/path_test.go
deleted file mode 100644
index 6f2c0bfb7..000000000
--- a/core/assets/path_test.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package assets
-
-import (
- "strings"
- "testing"
-)
-
-func TestPath(t *testing.T) {
- if actual := Path(); !strings.HasSuffix(actual, ".coredns") {
- t.Errorf("Expected path to be a .coredns folder, got: %v", actual)
- }
-}