Closed dfang closed 4 years ago
pkger cannot parse string variables because if it should, it needs to run your code when pkging to determine what the sting variable t
contains.
But whereas if you have pkger.Open("/public/index.html")
i.e. defined as a string, it needs to just parse your code and not run it to know that it needs to embed /public/index.html
.
So you can either use the before
way you mentioned
or
before you open any file or directory include it
pkger.Include("/public/index.html")
make sense
it seems pkger.Open() can't pass string variable
it takes me a while to debug template not load issue in my issue, so i started it with simple.
steps to reproduce:
https://github.com/markbates/pkger/tree/master/examples/open/pkger
change run method in
main.go