read.go
func readFile(path string, opts *Options) (*File, error) {
	var data []byte
	var err error

	if path != "" {
		name := filepath.Join(opts.BaseDir, path+dot+opts.Extension)

		if opts.Asset != nil {
			data, err = opts.Asset(name)
		} else {
			data, err = ioutil.ReadFile(name)
		}

		if err != nil {
			return nil, err
		}
	}

	return NewFile(path, data), nil
}
func readFile(path string, opts *Options) (*File, error) {
	var data []byte
	var err error

	if path != "" {
		name := filepath.Join(opts.BaseDir, path+dot+opts.Extension)

		if opts.Asset != nil {
			data, err = opts.Asset(name)
		} else {
			data, err = ioutil.ReadFile(name)
		}

		if err != nil {
			return nil, err
		}
	}

	return NewFile(path, data), nil
}
// readFile reads a file and returns a file struct.