diff --git a/format/format.go b/format/format.go index 9421e0605..d1ecb4d24 100644 --- a/format/format.go +++ b/format/format.go @@ -103,7 +103,7 @@ func (f *Format) format(path string) error { } func write(path string, contents []byte) error { - f, err := ioutil.TempFile(filepath.Split(path)) + f, err := ioutil.TempFile(filepath.Dir(path), filepath.Base(path)) if err != nil { return err }