Skip to content

Commit

Permalink
fix fileStat close when open failed on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
chai2010 committed Feb 24, 2018
1 parent e386421 commit 916ad4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resource/template/fileStat_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
func fileStat(name string) (fi fileInfo, err error) {
if isFileExist(name) {
f, err := os.Open(name)
defer f.Close()
if err != nil {
return fi, err
}
defer f.Close()
stats, _ := f.Stat()
fi.Mode = stats.Mode()
h := md5.New()
Expand Down

0 comments on commit 916ad4a

Please sign in to comment.