forked from mirror/afero
Fixes a data race caused by not locking the mem.FileData for read access.
This commit is contained in:
parent
b28a7effac
commit
40ffa2c25c
mem
|
@ -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