New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
builtin: New function for resource loading #4623
Labels
Milestone
Comments
What's "magic" with this approach? The only difference is that the compiler would assign the binary contents of a file to some variable instead of parsing code and then doing exactly the same with a constant. It would just expand on concepts that go already uses for specific architectures (e.g. "_<arch>.go"). |
@4: 1) A built-in compiler magic function is a function which cannot be written in the by-the-compiler-accepted-language per se, in case of Go e.g. `new`, `append`, `make`, len, ... 2) That's the essence of "I don't like this approach". 3) IMO not. `_<arch>` is external to both the language as it is to any built-ins/predeclared stuff. |
Adding a builtin is a language change. This doesn't merit a language change. If we need to support baked-in copies of binary data - and that's unclear to me - then it would be easy to define: package resource func Load(name string) ([]byte, error) func Install(name string, data []byte) and then have the "resource compiler" arrange to call resource.Install during a func init. No language change needed. However, I am not suggesting that we do this. It's a big topic and it's unclear that that's the right API. I'm merely pointing out that it doesn't require a language change. Russ |
The golang-nuts discussion points out https://bitbucket.org/tebeka/nrsc https://github.com/jteeuwen/go-bindata Status changed to WontFix. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: