Reputation: 915
One important feature of the Go programming language is that it produces statically linked binaries. However, when I ran ldd *
in my $GOPATH/bin
, I found several dynamic executables. Is there a clear set of rules to understand under what circumstances does the go compiler produce dynamically linked binaries?
Upvotes: 5
Views: 4922
Reputation: 752
Go 1.8 has introduced something called Go Plugin which seems to be using dynamic linking.
https://golang.org/pkg/plugin/
Upvotes: 1
Reputation: 79774
When using cgo, which is how Go links to C programs, which can of course use dynamically-linked libraries.
Upvotes: 4