mirror of https://github.com/spf13/afero.git
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:
commit
5596f5f73e
|
@ -107,6 +107,8 @@ func (f *File) Close() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *File) Name() string {
|
func (f *File) Name() string {
|
||||||
|
f.fileData.Lock()
|
||||||
|
defer f.fileData.Unlock()
|
||||||
return f.fileData.name
|
return f.fileData.name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue