-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
https://github.com/golang/go/blob/go1.16beta1/src/cmd/compile/internal/gc/embed.go#L224
You can already do this with a little code generation, see this wrapper I wrote to add encryption to embed, something similar could easily be done I might even add it in the future.
I would probably put my embed and generate directives in the same file for convenience, then I would write a package main file that does your minification work(if you can). Take a look at what I did here. It’s actually a full binary to download the code, and go generate will call it. In your case, this would be your minifier. You would need to make sure you call “go generate” before “go build” if you’ve made any changes to code that might need minified. Mage might be a good option to help you with this, since, unlike the embed directive, generate directives must be manually called.
I've made an http file server to serve pre-compressed or decompressed files out of embedded fs based on Accept-Encoding header: https://github.com/vearutop/statigz.