From 44fa940db4306ea3bf94c6325782fb83c8ec91d1 Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:17:10 +0800 Subject: [PATCH] avoid shortened names --- filestore/fsrefstore.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filestore/fsrefstore.go b/filestore/fsrefstore.go index 61908cdf3f..eb7f190d07 100644 --- a/filestore/fsrefstore.go +++ b/filestore/fsrefstore.go @@ -36,7 +36,7 @@ type FileManager struct { AllowUrls bool ds ds.Batching root string - readerFact func(path string) (FileReader, error) + makeReader func(path string) (FileReader, error) } // CorruptReferenceError implements the error interface. @@ -61,7 +61,7 @@ func (c CorruptReferenceError) Error() string { // CreateFileMapping on Windows) avoids this issue. func WithMMapReader() Option { return func(f *FileManager) { - f.readerFact = newMmapReader + f.makeReader = newMmapReader } } @@ -72,7 +72,7 @@ func NewFileManager(ds ds.Batching, root string, options ...Option) *FileManager f := &FileManager{ ds: dsns.Wrap(ds, FilestorePrefix), root: root, - readerFact: newStdReader, + makeReader: newStdReader, } for _, option := range options { @@ -199,7 +199,7 @@ func (f *FileManager) readFileDataObj(m mh.Multihash, d *pb.DataObj) ([]byte, er p := filepath.FromSlash(d.GetFilePath()) abspath := filepath.Join(f.root, p) - fi, err := f.readerFact(abspath) + fi, err := f.makeReader(abspath) if os.IsNotExist(err) { return nil, &CorruptReferenceError{StatusFileNotFound, err} } else if err != nil {