Please go through below links before writing Go plugin
Traditionally, writing a plugin for Go involved implementing some pre-defined java interfaces which exist for the each extension point. We call them Java interface/class based plugin API. With time, we noticed many shortcomings in this approach, one of them being the interfaces went out of date even if a new field was added. This broke all existing plugins without providing enough time for the plugin authors to make appropriate changes to their respective plugins and make a release. This raised a need for an alternate approach to write plugins. With version 14.4.0 Go introduced support for JSON message based plugin API. This still deals with a few java classes, but the dynamic part which is the details being sent back and forth between Go and plugin is in the form of JSON data. In order to support existing plugins and provide enough time to the plugin authors to migrate these to use the newer APIs, Go still works with old java interface based plugin API. However, this support will be removed eventually and hence all plugin authors are adviced to write new plugins using JSON based API, and also migrate their existing plugins to the same.
JSON message based plugin API has been described in further details here.
You can find the latest API jar file with its associated sources and javadocs on Maven Central.