Merge pull request #8 from jomenxiao/patch-1

This commit is contained in:
siddontang 2017-05-17 15:08:08 +08:00 committed by GitHub
commit cb568a3e5c
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ import (
// Write file to temp and atomically move when everything else succeeds.
func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error {
dir, name := path.Split(filename)
dir, name := path.Dir(filename), path.Base(filename)
f, err := ioutil.TempFile(dir, name)
if err != nil {
return err