Re:Teaching Distributed Systems in Go
by DennisP on Tuesday February 12, 2013 @11:34AM
(#5207804)
What's this about "you can't hand out precompiled library code and use the go build tools"...you really can't have binary libraries in Go and use the standard tools? That seems a bit strange for a native-compiled language.
[ Parent
| on HN ]
Not true (anymore).
https://groups.google.com/forum/?fromgroups=#!searchin/golan...
Hi, Jabbles - alas, scroll down a bit in that problem report and you'll see a later commit by Russ that removed the support:
"I removed support for this shortly before Go 1, because it was causing worse problems. My intention is to allow this usage in Go 1.1, but only if there is no src directory in the GOPATH tree in question. That is, if you create a directory listed in GOPATH that has _no source at all_, then it will be treated as binary-only."
Go is all statically linked, so there's no such thing as DLLs made in Go. Creating DLLs may be possible in later versions of Go, however.
You could compile the .a files for the different architectures, and let them link against that, instead of recompiling and linking from your source--but the 'go' tool won't currently accept it if there's no source. That could change, and there is a workaround (IIRC): Make an empty folder in the src/import/path.