Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



Project go-gir-generator implements GObject-introspection based bindings generator for Go.

There are many Go bindings of GObject/Gtk libraries out there, but almost all of them are written by hand. It's boring and error-prone since the corresponding C library may change very often. go-gir-generator can adapt to the newest version of GObject without changing one single line of code, which makes it less painful to write Go code with GObject.

NOTE: Currently it only supports GObject-2.0, Glib-2.0, Gio-2.0, support of Gdk/Gtk is not completed.

Many thanks to the genius guys who created the GObject Introspection and the original author nsf.


Build dependencies

  • golang 1.3 above
  • pkg-config
  • gobject-introspection-1.0

Runtime dependencies

  • gobject-introspection-1.0


Install prerequisites

$ apt-get install libgirepository1.0-dev libgudev-1.0-dev
$ make install


The binary program gir-generator is the static binding code generator. It read the GIRepository and template files from directory.

For example, we need generate gobject-2.0 binding,

gir-generator -o .

Note: deepin generate all bindings under $GOPATH/src/gir/$PackageName

Getting help

Any usage issues can ask for help via

Getting involved

We encourage you to report issues and contribute changes


go-gir-generator is licensed under GPLv3.