On Sun, May 26, 2019, at 13:44, Mark Bauermeister wrote:
> Is there any alternative that would allow loading the files
> dynamically during development and baking them into the source upon
> release? Or am I better off just writing some custom logic that simply
> tries to load the file from the file system and, upon failing, reverts
> to the baked data?

In my own projects I use a fork of JDB's "statik" [1] that I called
"pkgzip" [2]. The main point of forking was to avoid import side
effects, but it can load things in "dev mode" which means that it
reloads them on every refresh from the filesystem, or in live mode where
it loads them from a virtual file system that is pre-compiled. It's not
exactly what you want right now, but it would require very little
tweaking to be useful for you.

I've quickly thrown the source up here [2] and published it as
"code.soquee.net/pkgzip" in case it's useful to you or anyone else here.
The repo will likely move once SourceHut supports separate
organizations, but the vanity import will remain the same.

—Sam

P.S. Note that this package was just thrown up and DNS may not have
     propagated everywhere yet. If you're getting TLS errors from
     Netlify or can't look up the domain at all, wait 24 hours or so for
     DNS to finish propagating and for the new certs to be deployed.

[1]: https://github.com/rakyll/statik
[2]: https://git.sr.ht/~samwhited/pkgzip

-- 
Sam Whited

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/233754d2-3069-4d00-8179-ac1f617fdb55%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to