Skip to content

Commit

Permalink
Merge pull request peterbourgon#59 from mchtech/master
Browse files Browse the repository at this point in the history
(*File).Chmod on Windows
  • Loading branch information
peterbourgon authored Apr 3, 2020
2 parents 0be1b92 + c6413ac commit cada2b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diskv.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (d *Diskv) createKeyFileWithLock(pathKey *PathKey) (*os.File, error) {
return nil, fmt.Errorf("temp file: %s", err)
}

if err := f.Chmod(d.FilePerm); err != nil {
if err := os.Chmod(f.Name(), d.FilePerm); err != nil {
f.Close() // error deliberately ignored
os.Remove(f.Name()) // error deliberately ignored
return nil, fmt.Errorf("chmod: %s", err)
Expand Down

0 comments on commit cada2b7

Please sign in to comment.