Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Using Go Shared Libraries

This project demonstrates a few new features that were added or improved in the Go 1.5 release:

  • -buildmode=shared - The ability to create a .so file from a Go package that can be called by other Go programs.
  • -linkshared - The ability to compile and link a Go program aginst previously compiled shared libraries.
  • -buildmode=c-shared - The ability to create a c-style .so file from a Go package that can be called by other languages.

This work is based on the Execmodes proposal found here. Keep in mind that this has only been tested on Linux. Certain features are not yet available on all Go platforms.

To get started, you'll need a working Go 1.5 installation. If you haven't already upgraded, follow the [download and install instructions here] (

To use these examples locally, I suggest you clone this repo:

$ mkdir buildmodeshared
$ git clone buildmodeshared

Once you have the repo cloned, see the gofromgo and gofrompython directories for next steps.

  • Go from Go - The ability to compile a Go program that is dynamically linked to other Go libraries.
  • Go from Python - The ability to compile a set of Go packages into a C-style shared library that can be invoked from other languages, such as Pyhon.


For details, see CONTRIBUTING.


For details, see LICENSE.


This is not an official Google project.


How to use Go to build shared libraries




No releases published
You can’t perform that action at this time.