From 88b798517d1f87fb0dd9c5f74257a8d7e1b804f9 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 17 Apr 2018 09:59:31 +0900 Subject: [PATCH] pass empty string into ioutil.TempDir TempDir uses the default directory for temporary files if dir is empty --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 0bb0362..78a0e77 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,7 @@ func (n *PhiEditor) init(cfg *cfg.TomlConfig) { } } else { // we have no args, open up a scratch file - tempFile, err := ioutil.TempFile("/var/tmp/", "phi-editor-") + tempFile, err := ioutil.TempFile("", "phi-editor-") if err != nil { log.Println("Failed to create temp file", err.Error()) os.Exit(1)