Skip to content

Commit

Permalink
Merge pull request kelseyhightower#675 from chai2010/master
Browse files Browse the repository at this point in the history
fix fileStat close when open failed on windows
  • Loading branch information
okushchenko authored Feb 24, 2018
2 parents e386421 + 916ad4a commit ccc17eb
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 ccc17eb

Please sign in to comment.