replace mmap.Open() with os.Open()

This commit is contained in:
rick olson 2017-09-19 15:41:39 -06:00
parent d6926353f0
commit 0abeea3977
2 changed files with 5 additions and 6 deletions

@ -8,8 +8,8 @@ type Chain interface {
// delta-base chain successively to itself.
//
// If there was an error in the delta-base resolution, i.e., the chain
// is malformed, has a bad instruction, or there was an mmap-related
// read error, this function is expected to return that error.
// is malformed, has a bad instruction, or there was a file read error, this
// function is expected to return that error.
//
// In the event that a non-nil error is returned, it is assumed that the
// unpacked data this function returns is malformed, or otherwise

@ -2,11 +2,10 @@ package pack
import (
"fmt"
"os"
"path/filepath"
"regexp"
"sort"
"golang.org/x/exp/mmap"
)
// Set allows access of objects stored across a set of packfiles.
@ -54,12 +53,12 @@ func NewSet(db string) (*Set, error) {
name := submatch[1]
packf, err := mmap.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.pack", name)))
packf, err := os.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.pack", name)))
if err != nil {
return nil, err
}
idxf, err := mmap.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.idx", name)))
idxf, err := os.Open(filepath.Join(pd, fmt.Sprintf("pack-%s.idx", name)))
if err != nil {
return nil, err
}