pkger/internal/examples/extfile/main.go

29 lines
327 B
Go
Raw Normal View History

2019-07-31 00:21:26 +03:00
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/markbates/pkger"
)
func main() {
2019-07-31 23:29:49 +03:00
f, err := pkger.Open("github.com/gobuffalo/buffalo:/go.mod")
2019-07-31 00:21:26 +03:00
if err != nil {
log.Fatal("1", err)
}
defer f.Close()
fi, err := f.Stat()
if err != nil {
log.Fatal("2", err)
}
fmt.Println(fi)
io.Copy(os.Stdout, f)
}