示例#1
0
文件: interp.go 项目: vron/sem
// Return a new File that commands may be run on, with the dot defaulting
// to the entire file. Note that if the backing memfile is changed the dot
// will no longer be up to date!
func New(f memfile.File) (*File, error) {
	if f != nil {
		return &File{f: f, dot: Adr{Start: 0, End: f.Length()}}, nil
	}
	return nil, errors.New("Need a backing file")
}