genesis icon indicating copy to clipboard operation
genesis copied to clipboard

Making the filesystem walkable?

Open matthewmueller opened this issue 7 years ago • 0 comments

I was wondering if you had any interest in making the http.FileSystem walkable? I'd be happy to contribute this feature.

The use case is to be able to be able precompile templates on startup, rather than on the request. http.Dir(...) already supports walking the filesystem, so the idea is that you'd have two walkable filesystems, http.Dir for development, genesis.FileSystem() for production.

The walk function would be nearly the same as filepath.Walk. Here's what that would look like: https://github.com/shurcooL/httpfs/blob/master/vfsutil/walk.go#L12-L22

Thanks for creating this library!

matthewmueller avatar Nov 27 '18 04:11 matthewmueller