func As(ar *txtar.Archive) fs.FS {
	m := make(mapfs.MapFS, len(ar.Files))
	for _, f := range ar.Files {
		m[f.Name] = &mapfs.MapFile{
			Data: f.Data,
			Sys: f,
		}
	}
	m.ChmodAll(0666)
	return m
}
As returns an fs.FS containing ar's contents.
Subsequent changes to ar may or may not
be reflected in the returned fs.FS.
package txtarfs
import (
	"io/fs"
	"github.com/josharian/mapfs"
	"golang.org/x/tools/txtar"
)