Merge pull request #95 from jaqx0r/read-data-race

Fixes a data race caused by not locking the mem.FileData for read access.
This commit is contained in:
Martin Bertschler 2016-08-21 10:28:07 +02:00 committed by GitHub
commit 5596f5f73e
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,8 @@ func (f *File) Close() error {
}
func (f *File) Name() string {
f.fileData.Lock()
defer f.fileData.Unlock()
return f.fileData.name
}