Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Commit 471d0e6

Browse files
committed
doesn't create file on windows
1 parent 019d166 commit 471d0e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ func toImg(useClipboard bool, source, outFile string, lexer, style string) error
245245
if err != nil {
246246
return err
247247
}
248-
defer tmp.Close()
249248

250249
if _, err := io.Copy(tmp, buf); err != nil {
251250
return err
252251
}
253252

253+
tmp.Close()
254254
return os.Rename(tmp.Name(), outFile)
255255
}

0 commit comments

Comments
 (0)