$ go build -buildmode=c-shared
Or then just wait until it gets eventually implemented by the core team.