可以用swig移植gui功能

I was wondering if it would be possible to port the gtk gui framework to Go with the swig wrapper? Or am I just living in a fantasy world?

Technically, yes. It looks like SWIG support for Go is limited right now.

The real problem with simple SWIG wrappers is the ugly details leak through. The produced interface would need a layer on top of it in order to provide "Goish" behavior, especially in regards to garbage collection and interfaces.

Yes, it's possible. SWIG isn't even strictly necessary, but it does make the process more automatic.

There's already a GTK binding for Go in progress here: http://github.com/mattn/go-gtk