func (fs *flushFS) ReadFile( ctx context.Context, op *fuseops.ReadFileOp) (err error) { fs.mu.Lock() defer fs.mu.Unlock() // Ensure the offset is in range. if op.Offset > int64(len(fs.fooContents)) { return } // Read what we can. op.BytesRead = copy(op.Dst, fs.fooContents[op.Offset:]) return }