Skip to content

Commit

Permalink
avoid shortened names
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Sep 18, 2024
1 parent 6e22b09 commit 44fa940
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filestore/fsrefstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
}

Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 44fa940

Please sign in to comment.