Go plugin

A cherry picked version of #206.
Any special reason for using 16 here and not -1?