pass empty string into ioutil.TempDir

TempDir uses the default directory for temporary files if dir is empty
This commit is contained in:
Yasuhiro Matsumoto 2018-04-17 09:59:31 +09:00
parent 374ea255ec
commit 88b798517d
No known key found for this signature in database
GPG Key ID: 622DE34DC490584B

View File

@ -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)