Thanks for the replies, I appreciate it a lot. I understand there are a
couple of different solutions to this issue, and for this project in
particular. I have tried to sum the options:
1. *Use go/build to locate package dir:* fails, as mentioned, because
when a developer builds a program using my package, and distributes it, the
user won't have the assets
2. *Compile asset files into the executable:* could work for this
project, but fails for bigger projects, ugly, takes up unnecessary memory
3. *Distribute asset directory along with the package and executables:*requires user setup
I think I will go with option 3. I think I can live with the setup cost for
the moment. Option 2 could also work for me since it's a small amount of
files, if there is a clean way of doing it.
Thanks again for the response
On Thursday, November 1, 2012 7:30:41 PM UTC+11, Didrik Nordström wrote:
Hi, I am writing a package which requires some static assets (in this case
a small number of HTML template files and static javascript resources)
which I need to read at runtime (preferred) OR compile them into the binary
directly. I want the package to be easily installed and compiled, having
the assets referenced in some convenient way. Is there a pattern for this,
i.e. to distribute the package with a separate asset-directory? How would
you do?
--