I am working on a go library which I intend to distribute as a binary artifact. Now I am aware that there are different -buildmode
options and archive
should pretty much do that for me and go 1.7+'s //go:binary-only-package
makes the trick official.
However, when I build my library the resulting archive (*.a
) contains my library only, not any dependencies. I am in fact having a dependency which itself is binary only and comes as a statically linked archive itself (it's a C library which I am integrating with).
Using proper native code archives I am actually able to assemble such a fat archive using ar
or libtool
trickery - but these tools do not really work with my go artifacts.
Is there a way I can distribute a single *.a
file or do I have to resort to packaging multiple archives into, say, a zip file which resembles the directory structure in $GOPATH
and tell the my client's developers to just unzip that into their $GOPATH
and be done with it?