18 lines
539 B
Go
18 lines
539 B
Go
//go:build !unix
|
|
|
|
// Non-unix fallback for SnapshotReader: ReadFile into a []byte. Functionally
|
|
// identical to the unix mmap path — same reader code, same lookups — just
|
|
// pays the full resident-set cost at Open. Production mmap-on-Linux/Darwin;
|
|
// this exists for windows / plan9 / wasm builds.
|
|
package catalog
|
|
|
|
import "os"
|
|
|
|
func loadSnapshotBytes(path string) (data []byte, closer func() error, err error) {
|
|
data, err = os.ReadFile(path)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
return data, func() error { return nil }, nil
|
|
}
|