aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/spf13/afero
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/afero')
-rw-r--r--vendor/github.com/spf13/afero/mem/file.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/github.com/spf13/afero/mem/file.go b/vendor/github.com/spf13/afero/mem/file.go
index 9096ff0..3c1e09a 100644
--- a/vendor/github.com/spf13/afero/mem/file.go
+++ b/vendor/github.com/spf13/afero/mem/file.go
@@ -59,7 +59,9 @@ type FileData struct {
modtime time.Time
}
-func (d FileData) Name() string {
+func (d *FileData) Name() string {
+ d.Lock()
+ defer d.Unlock()
return d.name
}
@@ -107,9 +109,7 @@ func (f *File) Close() error {
}
func (f *File) Name() string {
- f.fileData.Lock()
- defer f.fileData.Unlock()
- return f.fileData.name
+ return f.fileData.Name()
}
func (f *File) Stat() (os.FileInfo, error) {