utils/importer.go
func newInternalFS(prefix string) http.FileSystem {
	// Asset/AssetDir returns `fmt.Errorf("Asset %s not found")`,
	// which does _not_ get mapped to 404 by `http.FileSystem`.
	// Need to convert to `os.ErrNotExist` explicitly ourselves.
	mapNotFound := func(err error) error {
		if err != nil && strings.Contains(err.Error(), "not found") {
			err = os.ErrNotExist
		}
		return err
	}
	return &assetfs.AssetFS{
		Asset: func(path string) ([]byte, error) {
			ret, err := Asset(path)
			return ret, mapNotFound(err)
		},
		AssetDir: func(path string) ([]string, error) {
			ret, err := AssetDir(path)
			return ret, mapNotFound(err)
		},
		Prefix: prefix,
	}
}
func newInternalFS(prefix string) http.FileSystem {
	// Asset/AssetDir returns `fmt.Errorf("Asset %s not found")`,
	// which does _not_ get mapped to 404 by `http.FileSystem`.
	// Need to convert to `os.ErrNotExist` explicitly ourselves.
	mapNotFound := func(err error) error {
		if err != nil && strings.Contains(err.Error(), "not found") {
			err = os.ErrNotExist
		}
		return err
	}
	return &assetfs.AssetFS{
		Asset: func(path string) ([]byte, error) {
			ret, err := Asset(path)
			return ret, mapNotFound(err)
		},
		AssetDir: func(path string) ([]string, error) {
			ret, err := AssetDir(path)
			return ret, mapNotFound(err)
		},
		Prefix: prefix,
	}
}
func newInternalFS ( prefix string ) http . FileSystem { // Asset/AssetDir returns `fmt.Errorf("Asset %s not found")`, // which does _not_ get mapped to 404 by `http.FileSystem`. // Need to convert to `os.ErrNotExist` explicitly ourselves. mapNotFound := func ( err error ) error { if err != nil && strings . Contains ( err . Error ( ) , " " ) { err = os . ErrNotExist } return err } return & assetfs . AssetFS { Asset : func ( path string ) ( [ ] byte , error ) { ret , err := Asset ( path ) return ret , mapNotFound ( err ) } , AssetDir : func ( path string ) ( [ ] string , error ) { ret , err := AssetDir ( path ) return ret , mapNotFound ( err ) } , Prefix : prefix , } }
//go:generate go-bindata -nometadata -ignore .*_test\.|~$DOLLAR -pkg $GOPACKAGE -o bindata.go -prefix ../ ../lib/...
go : generate go - bindata - nometadata - ignore . * _test \ . |~$DOLLAR - pkg $GOPACKAGE - o bindata . go - prefix .. / .. / lib / ...