pkger/pkging/waretest/fstest.go

32 lines
472 B
Go
Raw Normal View History

2019-09-02 01:02:45 +03:00
package waretest
2019-09-01 05:45:22 +03:00
import (
2019-09-02 01:02:45 +03:00
"github.com/markbates/pkger/pkging"
2019-09-01 05:45:22 +03:00
)
2019-09-02 01:02:45 +03:00
func Files(fx pkging.Warehouse) (TestFiles, error) {
2019-09-01 05:45:22 +03:00
tf := TestFiles{}
for _, f := range fileList {
2019-09-01 22:42:22 +03:00
pt, err := fx.Parse(f)
2019-09-01 06:29:25 +03:00
if err != nil {
return tf, err
}
tf[pt] = TestFile{
Name: pt.Name,
Path: pt,
2019-09-01 05:45:22 +03:00
}
}
return tf, nil
}
var fileList = []string{
"/main.go",
"/go.mod",
"/go.sum",
"/public/index.html",
"/public/images/mark.png",
"/templates/a.txt",
"/templates/b/b.txt",
}