Skip to content

Commit 0d32292

Browse files
mocherylarp242
authored andcommitted
Append Go file type when creating temporary file
A lot of scripts filter files based on their name to make sure they operate only on the appropriate content. By appending a Go file type to a temporary file when running a formatter, we add support for a broader range of Go formating tools. Fixes fatih#208
1 parent 7904a27 commit 0d32292

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/go/fmt.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function! go#fmt#Format(withGoimport) abort
5858
endif
5959

6060
" Write current unsaved buffer to a temp file
61-
let l:tmpname = tempname()
61+
let l:tmpname = tempname() . '.go'
6262
call writefile(go#util#GetLines(), l:tmpname)
6363
if go#util#IsWin()
6464
let l:tmpname = tr(l:tmpname, '\', '/')

0 commit comments

Comments
 (0)