diff --git a/command_test.go b/command_test.go index 7c1141d..41b353f 100644 --- a/command_test.go +++ b/command_test.go @@ -3,6 +3,7 @@ package main import ( "io/ioutil" "os" + "path/filepath" "strings" "testing" @@ -18,7 +19,7 @@ func setupTestCase(t *testing.T) { t.Log("Setup testcase") homeDir = manager.GetHomeDir() - memoFile = homeDir + "/.gomo-tmp/memo.json" + memoFile = filepath.Join(homeDir, ".gomo-tmp", "memo.json") os.Remove(memoFile) } @@ -27,7 +28,7 @@ func teardownTestCase(t *testing.T) { t.Log("Teardown testcase") homeDir = manager.GetHomeDir() - memoFile = homeDir + "/.gomo-tmp/memo.json" + memoFile = filepath.Join(homeDir, ".gomo-tmp", "memo.json") os.Remove(memoFile) } diff --git a/manager/manager.go b/manager/manager.go index 35e38f0..3eeafbb 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "os" + "path/filepath" "runtime" ) @@ -26,7 +27,7 @@ func New() *Manager { homeDir := GetHomeDir() return &Manager{ - file: homeDir + "/.gomo/memo.json", + file: filepath.Join(homeDir, ".gomo", "memo.json"), commands: make(map[string]Command), } }