Skip to content

Commit

Permalink
Append Go file type when creating temporary file
Browse files Browse the repository at this point in the history
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 #208
  • Loading branch information
mocheryl committed Dec 6, 2017
1 parent 7938c88 commit 94652a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/go/fmt.vim
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function! go#fmt#Format(withGoimport) abort
endif

" Write current unsaved buffer to a temp file
let l:tmpname = tempname()
let l:tmpname = tempname() . '.go'
call writefile(go#util#GetLines(), l:tmpname)
if go#util#IsWin()
let l:tmpname = tr(l:tmpname, '\', '/')
Expand Down

0 comments on commit 94652a3

Please sign in to comment.