pkger/examples/walk/packr/main.go

27 lines
357 B
Go
Raw Normal View History

2019-10-17 20:45:22 +03:00
package main
import (
"fmt"
"log"
"github.com/gobuffalo/packd"
"github.com/gobuffalo/packr/v2"
)
func main() {
if err := run(); err != nil {
log.Fatal(err)
}
}
func run() error {
box := packr.New("demo", "./public")
return box.Walk(func(path string, f packd.File) error {
fmt.Println("Name: ", f.Name())
fmt.Println()
return nil
})
}