func (b BytesLookup) Lookup() (io.ReadCloser, error) {
	return ioutil.NopCloser(bytes.NewReader(b)), nil
}
Lookup implements Lookup interface.
package file
import (
	"bytes"
	"context"
	"flag"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"github.com/gobwas/flagutil/parse"
)
type Syntax interface {
	Unmarshal([]byte) (map[string]interface{}, error)
}
type Lookup interface {
	Lookup() (io.ReadCloser, error)
}
var ErrNoFile = fmt.Errorf("file: no file")
type LookupFunc func() (io.ReadCloser, error)
func (f LookupFunc) Lookup() (io.ReadCloser, error) {
	return f()
}
type MultiLookup []Lookup
func (ls MultiLookup) Lookup() (io.ReadCloser, error) {
	for _, l := range ls {
		rc, err := l.Lookup()
		if err == ErrNoFile {
			continue
		}
		if err != nil {
			return nil, err
		}
		return rc, nil
	}
	return nil, ErrNoFile
}
type FlagLookup struct {
	FlagSet *flag.FlagSet
	Name    string
}
func LookupFlag(fs *flag.FlagSet, name string) *FlagLookup {
	return &FlagLookup{
		FlagSet: fs,
		Name:    name,
	}
}
func (f *FlagLookup) Lookup() (io.ReadCloser, error) {
	flag := f.FlagSet.Lookup(f.Name)
	if flag == nil {
		return nil, ErrNoFile
	}
	path := flag.Value.String()
	if path == "" {
		return nil, ErrNoFile
	}
	return os.Open(path)
}
type PathLookup string
func (p PathLookup) Lookup() (io.ReadCloser, error) {
	info, err := os.Stat(string(p))
	if os.IsNotExist(err) {
		return nil, ErrNoFile
	}
	if err != nil {
		return nil, err
	}
	if info.IsDir() {
		return nil, fmt.Errorf(
			"file: can't parse %s since its dir",
			p,
		)
	}
	return os.Open(string(p))
}
type BytesLookup []byte