This generates a much more efficient compiled form
I just ran the compilation on my Windows and Linux box with a tool that properly measured allocated VM.
The difference was about 200 MB in a total of ~7.4 GB allocation (from 7 MB source file).
So, after properly adjusting instrumentation tools it turns out the difference wasn't really that alarming. Sorry for causing the fuzz :-)
By using the -nomemcpy flag to go-bindata, the data is stored in a string instead, which go 1.3 should handle better.However, you should probably use a different method to store large assets. My method is to append a zip file to the end of you executable post-compile, and then use either zip -A to fix the zip header and use the archive/zip package, or use a package like my gopkg.in/cookieo9/resources-go.v2 package (don't need to zip -A then).
rsrc -data YOUR_INPUT.dat -o youroutput.syso > youroutput.c Generates a .syso file with specified opaque binary blob embedded, together with related .c file making it possible to access from Go code. Theoretically cross-platform, but reportedly cannot compile together with cgo. The generated *.syso and *.c files should get automatically recognized by 'go build' command and linked into an executable/library, as long as there are any *.go files in the same directory.
func get_youroutput() []byte It /tmp on disk, or in ram?
Dave
You can build test binaries with the -c flag, this should support the usual GOOS/GOARCH flags, but not tested.
The go tool also supports the -execcmd (from memory) flag which effectively inserts a shim, the cmd, before running your program, check out the various wrappers in the misc directory, this is who we do the darwin/arm and android builds.
Profiling will work as expected with a cross compiled binary, just scp back the binary and the profile to your workstation and use pprof as usual.
Dave