2019-07-31 00:21:26 +03:00
|
|
|
package pkger
|
|
|
|
|
2019-08-01 19:03:12 +03:00
|
|
|
import (
|
|
|
|
"os"
|
2019-07-31 00:21:26 +03:00
|
|
|
|
2019-08-01 19:03:12 +03:00
|
|
|
"github.com/markbates/pkger/paths"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WalkFunc func(paths.Path, os.FileInfo) error
|
2019-07-31 00:21:26 +03:00
|
|
|
|
|
|
|
func Walk(p string, wf WalkFunc) error {
|
2019-08-01 19:03:12 +03:00
|
|
|
pt, err := paths.Parse(p)
|
2019-07-31 00:21:26 +03:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return rootIndex.Walk(pt, wf)
|
|
|
|
}
|